public abstract class I18n
extends java.lang.Object
| Constructor and Description |
|---|
I18n(java.util.Locale defaultLanguage)
See
I18n for description. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addSupportedLanguages(java.util.Locale locale,
java.lang.String path) |
protected abstract void |
checkIfLanguageIsLoaded(java.util.Locale language) |
java.util.Locale |
getCurrentLanguage() |
java.util.Locale |
getDefaultLanguage() |
protected java.util.Map<java.util.Locale,java.lang.String> |
getLanguages() |
java.util.List<java.util.Locale> |
getSupportedLanguages() |
protected java.util.Map<java.util.Locale,Translation> |
getTranslations() |
java.lang.String |
getTranslationString(java.lang.String identifier) |
java.lang.String |
getTranslationString(java.lang.String identifier,
java.util.Locale language) |
java.lang.String |
getTranslationString(java.lang.String identifier,
java.lang.Object... args) |
protected abstract void |
loadLanguages() |
void |
setLanguage(java.util.Locale language) |
protected void |
setSupportedLanguages(java.util.Map<java.util.Locale,java.lang.String> supportedLanguages) |
protected void |
setTranslations(java.util.Map<java.util.Locale,Translation> translations) |
public I18n(java.util.Locale defaultLanguage)
I18n for description. The languages will be loaded from
/jsI18n/i18n.tns defaultLanguage - - default Language if system language is not supportedpublic void setLanguage(java.util.Locale language)
throws LanguageNotSupportedException
language - - language which should be setLanguageNotSupportedException - if the language is not supportedpublic java.util.Locale getDefaultLanguage()
public java.util.Locale getCurrentLanguage()
public java.lang.String getTranslationString(java.lang.String identifier)
identifier - - the identifier of the language stringpublic java.lang.String getTranslationString(java.lang.String identifier,
java.util.Locale language)
throws LanguageNotSupportedException
identifier - - the identifier of the language stringlanguage - - Locale of the wanted languageLanguageNotSupportedException - if the language is not supportedpublic java.lang.String getTranslationString(java.lang.String identifier,
java.lang.Object... args)
identifier - - the identifier of the language stringargs - - arguments referenced by the format specifiers in the language
string. String.format(String, Object...)protected abstract void checkIfLanguageIsLoaded(java.util.Locale language)
protected abstract void loadLanguages()
protected void setTranslations(java.util.Map<java.util.Locale,Translation> translations)
translations - the translations to setprotected void setSupportedLanguages(java.util.Map<java.util.Locale,java.lang.String> supportedLanguages)
supportedLanguages - the supportedLanguages to setprotected java.util.Map<java.util.Locale,java.lang.String> getLanguages()
public java.util.List<java.util.Locale> getSupportedLanguages()
protected void addSupportedLanguages(java.util.Locale locale,
java.lang.String path)
protected java.util.Map<java.util.Locale,Translation> getTranslations()