Class LocaleResolverDefault

java.lang.Object
org.spincast.plugins.localeresolver.LocaleResolverDefault
All Implemented Interfaces:
LocaleResolver

public class LocaleResolverDefault extends Object implements LocaleResolver
  • Constructor Details

    • LocaleResolverDefault

      @Inject public LocaleResolverDefault(SpincastConfig spincastConfig, com.google.inject.Provider<RequestContext<?>> requestContextProvider)
  • Method Details

    • 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()