Change display text of Actions for Arabic Locale in iBM Content

56 Views Asked by At

I have a requirement where I need to change the text of Actions like Add Document, Refresh, New Folder when in arabic. Can anyone point me towards any sample code that can help me accomplish this. Thanks in advance.

1

There are 1 best solutions below

0
Andreas Baaserud On

This is a quick and dirty way. An optional and probably a more maintainable way is to place all your translations in a property file, then load the text based on your locale.

public String changeMyText(Locale locale, String text) {
    if ("ar".equalsIgnoreCase(locale.getLanguage())) {
       if ("Actions".equalsIgnoreCase(text)) {
           return "arabic translation of actions";                
       }
    }
    return "no_valid_translation";
}