Package io.ultreia.java4all.i18n.spi
Class I18nLocaleHelper
- java.lang.Object
-
- io.ultreia.java4all.i18n.spi.I18nLocaleHelper
-
public class I18nLocaleHelper extends Object
Created by tchemit on 03/11/2018.- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Field Summary
Fields Modifier and Type Field Description static LocaleDEFAULT_LOCALEstatic org.nuiton.converter.LocaleConverterLOCALE_CONVERTER
-
Constructor Summary
Constructors Constructor Description I18nLocaleHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LocalenewLocale(String str)static LocalenewLocale(String language, String country)static Locale[]parseLocales(String str)Parse a list ofLocaleseperated by comma.static Set<Locale>parseLocalesAsSet(String str)Parse a list ofLocaleseperated by comma.
-
-
-
Field Detail
-
LOCALE_CONVERTER
public static final org.nuiton.converter.LocaleConverter LOCALE_CONVERTER
-
DEFAULT_LOCALE
public static final Locale DEFAULT_LOCALE
-
-
Method Detail
-
parseLocalesAsSet
public static Set<Locale> parseLocalesAsSet(String str) throws IllegalArgumentException
Parse a list ofLocaleseperated by comma.Example : fr_FR,en_GB
- Parameters:
str- the string representation of locale separated by comma- Returns:
- set of available locales
- Throws:
IllegalArgumentException- ia a locale is not valid
-
parseLocales
public static Locale[] parseLocales(String str) throws IllegalArgumentException
Parse a list ofLocaleseperated by comma.Example : fr_FR,en_GB
- Parameters:
str- the string representation of locale separated by comma- Returns:
- list of available locales
- Throws:
IllegalArgumentException- ia a locale is not valid
-
-