We use cookies to serve our customers and website visitors in the best possible way. Cookies are used for the proper functioning of the website and for improving the user experience, monitoring visitor traffic and marketing purposes. By continuing to browse the site, you agree to our use of cookies. You can read more about cookies here.
com.vaadin.flow.internal.
Class LocaleUtil
- java.lang.Object
-
- com.vaadin.flow.internal.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 Summary
All Methods Modifier and Type Method and Description static Optional<Locale>
getExactLocaleMatch(VaadinRequest request, List<Locale> providedLocales)
Get the exact locale match for the given request in the provided locales.
static Optional<Locale>
getLocaleMatchByLanguage(VaadinRequest request, List<Locale> providedLocales)
Get the locale matching the language of the request locale in the provided locales.
-
-
-
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 forprovidedLocales
- application provided localesReturns:
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 forprovidedLocales
- application provided localesReturns:
found locale or null if no matches by language
-
-