0

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 Answer 1

0

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";
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.