Class LocaleUtil

java.lang.Object
com.adobe.granite.i18n.LocaleUtil

public abstract class LocaleUtil extends Object
Utility class for locale handling.
  • Constructor Details

    • LocaleUtil

      public LocaleUtil()
  • Method Details

    • parseLocale

      public static Locale parseLocale(String text)
      Parses the given text to create its corresponding Locale. This method supports "-" and "_" as locale element separator.
      Parameters:
      text - string to parse
      Returns:
      the Locale
    • toRFC4646

      public static String toRFC4646(Locale locale)
      Converts the given locale to RFC 4646 format. e.g. "en_US" to "en-US".
      Parameters:
      locale - the Locale to convert to RFC 4646 format
      Returns:
      the string in RFC 4646 format corresponding to the submitted Locale