public class DefaultLocaleResolver extends java.lang.Object implements LocaleResolver, RequestLocaleResolver
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 and Description |
---|
DefaultLocaleResolver() |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.util.Locale> |
resolveLocale(HttpServletRequest request)
Return a non-
null but possiby empty list of
Locale instances to consider for localization of the current
request. |
java.util.List<java.util.Locale> |
resolveLocale(SlingHttpServletRequest request)
Return the Locales provided by the
ServletRequest.getLocales() method collected in a
List . |
public java.util.List<java.util.Locale> resolveLocale(SlingHttpServletRequest request)
ServletRequest.getLocales()
method collected in a
List
.resolveLocale
in interface LocaleResolver
resolveLocale
in interface RequestLocaleResolver
request
- The SlingHttpServletRequest
providing hints
and information for the Locale
resolution.Locale
s to use for internationalization
of request processingpublic java.util.List<java.util.Locale> resolveLocale(HttpServletRequest request)
LocaleResolver
null
but possiby empty list of
Locale
instances to consider for localization of the current
request. The list returned is assumed to be ordered by preference where
the first entry is the prefered Locale
and the last entry is
the least prefered Locale
.
Returning an empty list is equivalent to returning a singleton list whose
single entry is the ResourceBundleProvider.getDefaultLocale()
.
resolveLocale
in interface LocaleResolver
resolveLocale
in interface RequestLocaleResolver
request
- The SlingHttpServletRequest
providing hints
and information for the Locale
resolution.Locale
s to use for internationalization
of request processingorg.apache.sling.i18n.RequestLocaleResolver#resolveLocale(javax.servlet.http.HttpServletRequest)
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"