Class LocaleUtils
java.lang.Object
io.quarkiverse.cxf.transport.servlet.LocaleUtils
Utility methods for getting the locale from a request.
Copied from
https://github.com/quarkusio/quarkus-http/blob/da3bbbf1486fd07c935daceea285878ca1e64bdf/core/src/main/java/io/undertow/util/LocaleUtils.java
- Author:
- Stuart Douglas
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LocalegetLocaleFromString(String localeString) getLocalesFromHeader(String acceptLanguage) Parse a header string and return the list of locales that were found.getLocalesFromHeader(List<String> acceptLanguage) Parse a header string and return the list of locales that were found.
-
Constructor Details
-
LocaleUtils
public LocaleUtils()
-
-
Method Details
-
getLocaleFromString
-
getLocalesFromHeader
Parse a header string and return the list of locales that were found. If the header is empty or null then an empty list will be returned.- Parameters:
acceptLanguage- The Accept-Language header- Returns:
- The list of locales, in order of preference
-
getLocalesFromHeader
Parse a header string and return the list of locales that were found. If the header is empty or null then an empty list will be returned.- Parameters:
acceptLanguage- The Accept-Language header- Returns:
- The list of locales, in order of preference
-