|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.errai.ui.client.local.spi.TranslationService
public abstract class TranslationService
A base class for a generated translation service that includes all of the translation visible at compile time.
Constructor Summary | |
---|---|
TranslationService()
Constructor. |
Method Summary | |
---|---|
static String |
currentLocale()
|
String |
format(String key,
Object... args)
Look up a message in the i18n resource message bundle by key, then format the message with the given arguments and return the result. |
String |
getActiveLocale()
|
static String |
getBrowserLocale()
Gets the browser's configured locale. |
Collection<String> |
getSupportedLocales()
|
String |
getTranslation(String translationKey)
Gets the translation for the given i18n translation key. |
boolean |
isEnabled()
|
protected void |
registerBundle(String jsonData,
String locale)
Registers the bundle with the translation service. |
protected void |
registerJSON(JSONMap data,
String locale)
Registers some i18n data with the translation service. |
protected void |
registerTranslation(String key,
String value,
String locale)
Registers a single translation. |
static void |
retranslateTemplatedBeans()
Re-translate displayed Templated beans to the current locale. |
static void |
setCurrentLocale(String locale)
Forcibly set the current locale and re-translate all instantiated Templated beans. |
static void |
setCurrentLocaleWithoutUpdate(String locale)
Forcibly set the current locale but do not re-translate existing templated instances. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TranslationService()
Method Detail |
---|
public boolean isEnabled()
public Collection<String> getSupportedLocales()
protected void registerBundle(String jsonData, String locale)
jsonData
- protected void registerTranslation(String key, String value, String locale)
key
- value
- locale
- protected void registerJSON(JSONMap data, String locale)
data
- locale
- public String getTranslation(String translationKey)
translationKey
- public String format(String key, Object... args)
key
- args
- public String getActiveLocale()
public static String currentLocale()
public static final String getBrowserLocale()
public static final void setCurrentLocale(String locale)
Templated
beans.
locale
- public static final void setCurrentLocaleWithoutUpdate(String locale)
locale
- public static void retranslateTemplatedBeans()
Templated
beans to the current locale.
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |