Package com.jsql.util

Class I18nUtil

java.lang.Object
com.jsql.util.I18nUtil

public class I18nUtil extends Object
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 Details

    • BASE_NAME

      public static final String BASE_NAME
      See Also:
    • BUNDLE_ROOT

      public static final ResourceBundle BUNDLE_ROOT
      Bundle of standard i18n keys and translated text for root language English
  • Method Details

    • valueByKey

      public static String valueByKey(String key)
      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

      public static void setCurrentBundle(Locale newLocale)
    • getCurrentLocale

      public static Locale getCurrentLocale()