Package org.deeplearning4j.ui.i18n
Class DefaultI18N
- java.lang.Object
-
- org.deeplearning4j.ui.i18n.DefaultI18N
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_LANGUAGEstatic StringFALLBACK_LANGUAGE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDefaultLanguage()Get the currently set default language as an ISO 639-1 codestatic I18NgetInstance()Get global instance (used in single-session mode)static I18NgetInstance(String sessionId)Get instance for sessionStringgetMessage(String key)Get the specified message in the default language (according toI18N.getDefaultLanguage()StringgetMessage(String langCode, String key)Get the specified message for the specified languageMap<String,String>getMessages(String langCode)Get all internationalization messages for the specified language codestatic I18NremoveInstance(String sessionId)Remove I18N instance for sessionvoidsetDefaultLanguage(String langCode)Set the default language
-
-
-
Field Detail
-
DEFAULT_LANGUAGE
public static final String DEFAULT_LANGUAGE
- See Also:
- Constant Field Values
-
FALLBACK_LANGUAGE
public static final String FALLBACK_LANGUAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static I18N getInstance()
Get global instance (used in single-session mode)- Returns:
- global instance
-
getInstance
public static I18N getInstance(String sessionId)
Get instance for session- Parameters:
sessionId- session ID for multi-session mode, leave itnullfor global instance- Returns:
- instance for session, or global instance
-
removeInstance
public static I18N removeInstance(String sessionId)
Remove I18N instance for session- Parameters:
sessionId- session ID- Returns:
- the previous value associated with
sessionId, or null if there was no mapping forsessionId
-
getMessage
public String getMessage(String key)
Description copied from interface:I18NGet the specified message in the default language (according toI18N.getDefaultLanguage()- Specified by:
getMessagein interfaceI18N- Parameters:
key- Key value- Returns:
- Message for the given key, or null if none is found/available
-
getMessage
public String getMessage(String langCode, String key)
Description copied from interface:I18NGet the specified message for the specified language- Specified by:
getMessagein interfaceI18N- Parameters:
langCode- ISO 639-1 language code: "en", "ja", etckey- Key value for the message to retrieve- Returns:
- Message for the given key/language pair, or null if none is found
-
getDefaultLanguage
public String getDefaultLanguage()
Description copied from interface:I18NGet the currently set default language as an ISO 639-1 code- Specified by:
getDefaultLanguagein interfaceI18N- Returns:
- The current default language
-
setDefaultLanguage
public void setDefaultLanguage(String langCode)
Description copied from interface:I18NSet the default language- Specified by:
setDefaultLanguagein interfaceI18N- Parameters:
langCode- Language code, as an ISO 639-1 code
-
-