Package eu.woolplatform.utils.i18n
Class I18nUtils
- java.lang.Object
-
- eu.woolplatform.utils.i18n.I18nUtils
-
public class I18nUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description I18nUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LocalelanguageTagToLocale(String tag)Converts a language tag like "en-US" to a locale.
-
-
-
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
-
-