Package io.jmix.core

Class LocaleResolver

java.lang.Object
io.jmix.core.LocaleResolver

public class LocaleResolver extends Object
The LocaleResolver class transforms locales to strings and vice versa to support messages localization.
  • Constructor Details

    • LocaleResolver

      public LocaleResolver()
  • Method Details

    • resolve

      public static Locale resolve(String localeString)
      Parameters:
      localeString - the locale String or language tag.
      Returns:
      The locale that best represents the language tag or locale string.
      Throws:
      NullPointerException - if localeString is null
    • localeToString

      public static String localeToString(Locale locale)
      Returns:
      A string representation of the Locale without Extension or a BCP47 language tag if locale object contains Script