public class DefaultI18N extends Object implements I18N
Loading of these UI resources is done as follows:
- On initialization of the DefaultI18N:
- Resource files for the default language are loaded
- If a different language is requested, the content will be loaded on demand (and stored in memory for future use)
Note that if a specified language does not have the specified key, the result from the defaultfallback language (English)
will be used instead.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_LANGUAGE |
static String |
FALLBACK_LANGUAGE |
| Modifier and Type | Method and Description |
|---|---|
String |
getDefaultLanguage()
Get the currently set default language as an ISO 639-1 code
|
static I18N |
getInstance() |
String |
getMessage(String key)
Get the specified message in the default language (according to
I18N.getDefaultLanguage() |
String |
getMessage(String langCode,
String key)
Get the specified message for the specified language
|
boolean |
noI18NData() |
void |
setDefaultLanguage(String langCode)
Set the default language
|
public static final String DEFAULT_LANGUAGE
public static final String FALLBACK_LANGUAGE
public static I18N getInstance()
public boolean noI18NData()
public String getMessage(String key)
I18NI18N.getDefaultLanguage()getMessage in interface I18Nkey - Key valuepublic String getMessage(String langCode, String key)
I18NgetMessage in interface I18NlangCode - ISO 639-1 language code: "en", "ja", etckey - Key value for the message to retrievepublic String getDefaultLanguage()
I18NgetDefaultLanguage in interface I18Npublic void setDefaultLanguage(String langCode)
I18NsetDefaultLanguage in interface I18NlangCode - Language code, as an ISO 639-1 codeCopyright © 2018. All rights reserved.