Package com.adobe.granite.i18n
Class LocaleUtil
- java.lang.Object
-
- com.adobe.granite.i18n.LocaleUtil
-
public abstract class LocaleUtil extends java.lang.Object
Utility class for locale handling.
-
-
Constructor Summary
Constructors Constructor Description LocaleUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Locale
parseLocale(java.lang.String text)
Parses the given text to create its correspondingLocale
.static java.lang.String
toRFC4646(java.util.Locale locale)
Converts the given locale to RFC 4646 format.
-
-
-
Method Detail
-
parseLocale
public static java.util.Locale parseLocale(java.lang.String text)
Parses the given text to create its correspondingLocale
. This method supports "-" and "_" as locale element separator.- Parameters:
text
- string to parse- Returns:
- the
Locale
-
toRFC4646
public static java.lang.String toRFC4646(java.util.Locale locale)
Converts the given locale to RFC 4646 format. e.g. "en_US" to "en-US".- Parameters:
locale
- theLocale
to convert to RFC 4646 format- Returns:
- the string in RFC 4646 format corresponding to the submitted
Locale
-
-