Class LocaleNames

java.lang.Object
com.ultikits.ultitools.text.internal.LocaleNames

@Internal public final class LocaleNames extends Object
Locale identifiers used by catalogue names and configuration values.
  • Constructor Details

    • LocaleNames

      private LocaleNames()
  • Method Details

    • parse

      public static Optional<Locale> parse(@Nullable @Nullable String value)
      Parses a language or language-region identifier, omitting variants.
    • isAutomatic

      public static boolean isAutomatic(@Nullable @Nullable String value)
      Returns whether a configuration value selects automatic language resolution.
    • isSafeLanguageCode

      public static boolean isSafeLanguageCode(String code)
      Checks the ASCII allowlist for a configured language name, not the locale-tag grammar.
    • officialLanguageOf

      @Nullable public static @Nullable String officialLanguageOf(@Nullable @Nullable String configured, List<String> officialCodes)
      Returns the exact official code or the longest official prefix before a hyphen.
    • normalize

      public static Locale normalize(Locale locale)
      Keeps only a locale's language and country.