Class LocaleUtil


  • public final class LocaleUtil
    extends Object
    Utility class for locale handling.

    For internal use only. May be renamed or removed in a future release.

    Since:
    1.0
    • Method Detail

      • getExactLocaleMatch

        public static Optional<Locale> getExactLocaleMatch​(VaadinRequest request,
                                                           List<Locale> providedLocales)
        Get the exact locale match for the given request in the provided locales.
        Parameters:
        request - request to get locale for
        providedLocales - application provided locales
        Returns:
        found locale or null if no exact matches
      • getLocaleMatchByLanguage

        public static Optional<Locale> getLocaleMatchByLanguage​(VaadinRequest request,
                                                                List<Locale> providedLocales)
        Get the locale matching the language of the request locale in the provided locales.
        Parameters:
        request - request to get locale for
        providedLocales - application provided locales
        Returns:
        found locale or null if no matches by language