Class LocaleUtils
- java.lang.Object
-
- com.inductiveautomation.ignition.common.i18n.LocaleUtils
-
public final class LocaleUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.util.Locale>
getAvailableLocales(boolean andRegionalVariants)
Returns the available locales, sorted.static java.util.Optional<java.util.Locale>
parseLocale(java.lang.String locale)
Attempt to parse the given string into a locale - first, as a Java formatted locale, usingLocaleUtils.toLocale(String)
- but if that fails, then by parsing it as a language tag.
-
-
-
Method Detail
-
getAvailableLocales
public static java.util.List<java.util.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 java.util.Optional<java.util.Locale> parseLocale(@Nullable java.lang.String locale)
Attempt to parse the given string into a locale - first, as a Java formatted locale, usingLocaleUtils.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.
-
-