public.javadoc.org.spincast.plugins.localeresolver.LocaleResolverDefault.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
LocaleResolverDefault (org.spincast:spincast-framework 1.2.0 API)
org.spincast.plugins.localeresolver
Class LocaleResolverDefault
- java.lang.Object
-
- org.spincast.plugins.localeresolver.LocaleResolverDefault
-
- All Implemented Interfaces:
- LocaleResolver
public class LocaleResolverDefault
extends Object
implements LocaleResolver
-
-
Constructor Summary
Constructors
Constructor and Description
LocaleResolverDefault(SpincastConfig spincastConfig,
com.google.inject.Provider<RequestContext<?>> requestContextProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
Locale
getLocaleToUse()
The 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<?>>
getRequestContextProvider()
protected SpincastConfig
getSpincastConfig()
-
-
Constructor Detail
-
LocaleResolverDefault
@Inject
public LocaleResolverDefault(SpincastConfig spincastConfig,
com.google.inject.Provider<RequestContext<?>> requestContextProvider)
-
Method Detail
-
getSpincastConfig
protected SpincastConfig getSpincastConfig()
-
getRequestContextProvider
protected com.google.inject.Provider<RequestContext<?>> getRequestContextProvider()
-
getLocaleToUse
public Locale 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 interface LocaleResolver
- Returns:
- The best Locale to use. If none is found, returns
the default Locale, as defined by
SpincastConfig#getDefaultLocale()
Copyright © 2019. All rights reserved.