|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface LocalizationContext
A context for providing localization via exposing the current
Locale and ResourceBundles. The ResourceBundle of a different Locale
can be accessed without chaning the current Locale with getResourceBundle(Locale).
The current Locale can be changed with setLocale(Locale) and all
subsequent request to getResourceBundle() will use the new current Locale.
| Nested Class Summary | |
|---|---|
static interface |
LocalizationContext.LocaleChangeListener
|
| Method Summary | |
|---|---|
void |
addLocaleChangeListener(LocalizationContext.LocaleChangeListener listener)
|
Locale |
getLocale()
Returns the current session locale. |
String |
getMessage(String code,
Object[] args)
Localizes the code and uses it to format the message with the passed arguments. |
String |
getMessage(String code,
Object[] args,
String defaultMessage)
Localizes the code and uses it to format the message with the passed arguments. |
ResourceBundle |
getResourceBundle()
Returns a resource bundle corresponding to the current locale. |
ResourceBundle |
getResourceBundle(Locale locale)
Returns a resource bundle corresponding to arbitrary locale. |
String |
localize(String key)
Localizes a string returning one that corresponds to the current locale. |
boolean |
removeLocaleChangeListener(LocalizationContext.LocaleChangeListener listener)
|
void |
setLocale(Locale locale)
Sets the current session locale. |
| Method Detail |
|---|
Locale getLocale()
void setLocale(Locale locale)
String localize(String key)
ResourceBundle getResourceBundle()
ResourceBundle getResourceBundle(Locale locale)
String getMessage(String code,
Object[] args,
String defaultMessage)
java.text.MessageFormat.
If the localized message cannot be resolved uses defaultMessage instead.
String getMessage(String code,
Object[] args)
java.text.MessageFormat.
void addLocaleChangeListener(LocalizationContext.LocaleChangeListener listener)
boolean removeLocaleChangeListener(LocalizationContext.LocaleChangeListener listener)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||