Package org.apache.sling.i18n

# Class DefaultLocaleResolver

java.lang.Object
org.apache.sling.i18n.DefaultLocaleResolver

All Implemented Interfaces:
  `LocaleResolver`, `RequestLocaleResolver`

@Deprecated(since="2.3.0") public class DefaultLocaleResolver extends Object implements LocaleResolver, RequestLocaleResolver
Deprecated.
use `DefaultJakartaLocaleResolver` instead
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
Constructor
Description
`DefaultLocaleResolver()`
Deprecated.

## Method Summary

Modifier and Type
Method
Description
`List<Locale>`
`resolveLocale(javax.servlet.http.HttpServletRequest request)`
Deprecated.
Return a non-`null` but possibly empty list of `Locale` instances to consider for localization of the current request.
`List<Locale>`
`resolveLocale(org.apache.sling.api.SlingHttpServletRequest request)`
Deprecated.
Return the Locales provided by the `ServletRequest.getLocales()` method collected in a `List`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DefaultLocaleResolver

public DefaultLocaleResolver()
Deprecated.

## Method Details

### resolveLocale

public List<Locale> resolveLocale(org.apache.sling.api.SlingHttpServletRequest request)
Deprecated.
Return the Locales provided by the `ServletRequest.getLocales()` method collected in a `List`.

Specified by:
  `resolveLocale` in interface `LocaleResolver`
Parameters:
  `request` - The `SlingHttpServletRequest` providing hints and information for the `Locale` resolution.
Returns:
  The list of `Locale`s to use for internationalization of request processing

### resolveLocale

public List<Locale> resolveLocale(javax.servlet.http.HttpServletRequest request)
Deprecated.
Description copied from interface: `RequestLocaleResolver`
Return a non-`null` but possibly 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 preferred `Locale` and the last entry is the least preferred `Locale`.

Returning an empty list is equivalent to returning a singleton list whose single entry is the `ResourceBundleProvider.getDefaultLocale()`.

Specified by:
  `resolveLocale` in interface `RequestLocaleResolver`
Parameters:
  `request` - The `HttpServletRequest` providing hints and information for the `Locale` resolution.
Returns:
  The list of `Locale`s to use for internationalization of request processing
See Also:
  - `RequestLocaleResolver.resolveLocale(javax.servlet.http.HttpServletRequest)`