Class I18nUtils


  • public class I18nUtils
    extends Object
    • Constructor Detail

      • I18nUtils

        public I18nUtils()
    • Method Detail

      • languageTagToLocale

        public static Locale languageTagToLocale​(String tag)
                                          throws ParseException
        Converts a language tag like "en-US" to a locale. The language tag is the same format as in an HTTP Accept-Language header. It is case-insensitive.
        Parameters:
        tag - the language tag
        Returns:
        the locale
        Throws:
        ParseException - if the language tag is invalid