Class Strings

    • Field Detail

      • LANG_ENGLISH

        public static final Integer LANG_ENGLISH
        Constant int value for the natural language English.
      • LANG_GERMAN

        public static final Integer LANG_GERMAN
        Constant int value for the natural language German.
      • LANG_SPANISH

        public static final Integer LANG_SPANISH
        Constant int value for the natural language Spanish.
      • LANG_FRENCH

        public static final Integer LANG_FRENCH
        Constant int value for the natural language French.
      • DEFAULT_LANGUAGE

        public static final Integer DEFAULT_LANGUAGE
        Constant of the default language, LANG_ENGLISH.
      • ISO_639_LANGUAGE_CODES

        private static final String[] ISO_639_LANGUAGE_CODES
        ISO 639 two-letter country codes for the supported languages, lower case.
      • LANGUAGE_CONSTANTS

        private static final Integer[] LANGUAGE_CONSTANTS
      • DEFAULT_LANGUAGE_ISO_639_CODE

        public static final String DEFAULT_LANGUAGE_ISO_639_CODE
        The ISO 639 code for the default language DEFAULT_LANGUAGE.
      • isoToConstant

        private static Hashtable isoToConstant
        A hashtable that maps from ISO 639 country codes to Integer objects with the corresponding LANG_xyz constant for that language.
      • language

        private Integer language
    • Constructor Detail

      • Strings

        public Strings​(Integer languageConstant,
                       String[] stringValues)
        Create a new String object for the given language and fill it with the String array.
    • Method Detail

      • determineSuitableIsoCode

        public static String determineSuitableIsoCode()
        Determines an ISO 639 code of a language suitable for the environment in which the JVM is currently running. First calls determineIsoCodeFromDefaultLocale(). If that yields null, the ISO code for DEFAULT_LANGUAGE is returned. So different from determineIsoCodeFromDefaultLocale() this method always returns a non-null value.
        Returns:
        String with ISO 639 code of a language that fits the JVM environment, or the default language as fallback solution
      • determineIsoCodeFromDefaultLocale

        public static String determineIsoCodeFromDefaultLocale()
      • findLanguageCode

        public static Integer findLanguageCode​(String iso639LanguageCode)
      • getLanguage

        public Integer getLanguage()
        Returns the language of this object as one of the LANG_xyz constants of this class.
      • getFileName

        public static String getFileName​(int languageCode)
      • set

        public void set​(Integer languageConstant,
                        String[] values)