java.lang.Object
com.inductiveautomation.ignition.common.i18n.LocaleUtils

public final class LocaleUtils extends Object
  • Method Details

    • getAvailableLocales

      public static List<Locale> getAvailableLocales(boolean andRegionalVariants)
      Returns the available locales, sorted. If andRegionalVariants is true, they will be included, otherwise only the base languages will be returned.
    • parseLocale

      public static Optional<Locale> parseLocale(@Nullable String locale)
      Attempt to parse the given string into a locale - first, as a Java formatted locale, using LocaleUtils.toLocale(String) - but if that fails, then by parsing it as a language tag. Will attempt to return an empty optional, rather than an invalid locale.