Class HttpRequestXLanguageLocaleResolverImpl

java.lang.Object
ch.tocco.nice2.web.core.impl.servlet.locale.HttpRequestXLanguageLocaleResolverImpl
All Implemented Interfaces:
LocaleResolver, HttpRequestXLanguageLocaleResolver

@Component @Order(0) public class HttpRequestXLanguageLocaleResolverImpl extends Object implements HttpRequestXLanguageLocaleResolver
Holds the value of the X-Language request header.
  • Constructor Details

    • HttpRequestXLanguageLocaleResolverImpl

      public HttpRequestXLanguageLocaleResolverImpl()
  • Method Details

    • setXLanguage

      public void setXLanguage(@Nullable @Nullable String xLanguage)
      Sets the X-Language request header. Takes the first language (ignoring country) that is supported by nice.
      Specified by:
      setXLanguage in interface HttpRequestXLanguageLocaleResolver
      Parameters:
      xLanguage - (may be null and empty)
    • getPreferredLocales

      public Set<Locale> getPreferredLocales()
      Description copied from interface: LocaleResolver
      Return the current locales in order of preference.
      Specified by:
      getPreferredLocales in interface LocaleResolver
      Returns:
      May be empty if the user is not logged in and the X-Language header is not set therefore. The locales are ordered.