Class LocaleResolverDefault
java.lang.Object
org.spincast.plugins.localeresolver.LocaleResolverDefault
- All Implemented Interfaces:
LocaleResolver
-
Constructor Summary
ConstructorDescriptionLocaleResolverDefault
(SpincastConfig spincastConfig, com.google.inject.Provider<RequestContext<?>> requestContextProvider) -
Method Summary
Modifier and TypeMethodDescriptionThe default way to find the Locale to use is to check for a cookie, or otherwise use the request "Accept-Language" header.protected com.google.inject.Provider<RequestContext<?>>
protected SpincastConfig
-
Constructor Details
-
LocaleResolverDefault
@Inject public LocaleResolverDefault(SpincastConfig spincastConfig, com.google.inject.Provider<RequestContext<?>> requestContextProvider)
-
-
Method Details
-
getSpincastConfig
-
getRequestContextProvider
-
getLocaleToUse
The default way to find the Locale to use is to check for a cookie, or otherwise use the request "Accept-Language" header.- Specified by:
getLocaleToUse
in interfaceLocaleResolver
- Returns:
- The best Locale to use. If none is found, returns
the default Locale, as defined by
SpincastConfig#getDefaultLocale()
-