Package org.apache.sling.i18n
Class DefaultJakartaLocaleResolver
java.lang.Object
org.apache.sling.i18n.DefaultJakartaLocaleResolver
- All Implemented Interfaces:
JakartaRequestLocaleResolver
The
DefaultLocaleResolver resolves the request's Locale by
calling the ServletRequest.getLocales() method, which generally
will be the Servlet Container's implementation of this method and thus be
based on the client's Accept-Language header.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresolveLocale(jakarta.servlet.http.HttpServletRequest request) Return a non-nullbut possibly empty list ofLocaleinstances to consider for localization of the current request.
-
Constructor Details
-
DefaultJakartaLocaleResolver
public DefaultJakartaLocaleResolver()
-
-
Method Details
-
resolveLocale
Description copied from interface:JakartaRequestLocaleResolverReturn a non-nullbut possibly empty list ofLocaleinstances to consider for localization of the current request. The list returned is assumed to be ordered by preference where the first entry is the preferredLocaleand the last entry is the least preferredLocale.Returning an empty list is equivalent to returning a singleton list whose single entry is the
ResourceBundleProvider.getDefaultLocale().- Specified by:
resolveLocalein interfaceJakartaRequestLocaleResolver- Parameters:
request- TheHttpServletRequestproviding hints and information for theLocaleresolution.- Returns:
- The list of
Locales to use for internationalization of request processing - See Also:
-