|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.af.commons.Localizer
public class Localizer
A Singleton that manages ResourceBundles and allows changing Locales and Languages.
| Method Summary | |
|---|---|
void |
addResourceBundle(String name)
Adds a ResourceBundle to this Localizer. |
void |
clearAllAddedBundles()
Deletes all currently set messages and the cached list of added bundles, but will add the afcommons bundle at the end. |
static Localizer |
getInstance()
Get singleton instance. |
String |
getLanguage()
Returns the abbreviation of the current language, e.g. |
Locale |
getLocale()
Returns the currently used Locale of the localizer. |
String |
getString(String key)
Get a localized string, probably for some widget or message. |
void |
setLanguage(String lang)
Sets the current language, e.g. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Localizer getInstance()
public void addResourceBundle(String name)
name - Name of the ResourceBundle. Has to be on the class path.public Locale getLocale()
public String getLanguage()
public void setLanguage(String lang)
lang - Abbreviation of language.
public String getString(String key)
throws MissingResourceException
key - Key to access the string.
MissingResourceException - if no object for the given key can be foundpublic void clearAllAddedBundles()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||