Package com.jsql.util
Class I18nUtil
java.lang.Object
com.jsql.util.I18nUtil
Utility class managing different text translations like English, Chinese and Arabic.
It retrieves text in the current language of the system and also the one choice
manually by user.
If the current system language is not supported then the user is proposed to use
the community translation protocol.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final ResourceBundleBundle of standard i18n keys and translated text for root language English -
Method Summary
Modifier and TypeMethodDescriptionstatic voidVerify if there is a language properties file corresponding to the current system language.static Localestatic voidsetCurrentBundle(Locale newLocale) static StringvalueByKey(String key) Return the text corresponding to an i18n key in the properties.
-
Field Details
-
BASE_NAME
- See Also:
-
BUNDLE_ROOT
Bundle of standard i18n keys and translated text for root language English
-
-
Method Details
-
valueByKey
Return the text corresponding to an i18n key in the properties.- Parameters:
key- an i18n key in the properties- Returns:
- text corresponding to the key
-
checkCurrentLanguage
public static void checkCurrentLanguage()Verify if there is a language properties file corresponding to the current system language. If not then it invites the user to use the translation process. -
setCurrentBundle
-
getCurrentLocale
-