Class DelegatingLocaleResolver
java.lang.Object
org.craftercms.engine.util.spring.servlet.i18n.DelegatingLocaleResolver
- All Implemented Interfaces:
org.springframework.web.servlet.LocaleResolver
public class DelegatingLocaleResolver
extends Object
implements org.springframework.web.servlet.LocaleResolver
Implementation of
LocaleResolver that delegates the actual work to the ChainLocaleResolver if
available or to a default object. This provides backward compatibility for sites without translation configuration.- Since:
- 4.0.0
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.web.servlet.LocaleResolverThe defaultLocaleResolver -
Constructor Summary
ConstructorsConstructorDescriptionDelegatingLocaleResolver(org.springframework.web.servlet.LocaleResolver defaultLocaleResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.web.servlet.LocaleResolverresolveLocale(javax.servlet.http.HttpServletRequest request) voidsetLocale(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Locale locale)
-
Field Details
-
defaultLocaleResolver
protected org.springframework.web.servlet.LocaleResolver defaultLocaleResolverThe defaultLocaleResolver
-
-
Constructor Details
-
DelegatingLocaleResolver
@ConstructorProperties("defaultLocaleResolver") public DelegatingLocaleResolver(org.springframework.web.servlet.LocaleResolver defaultLocaleResolver)
-
-
Method Details
-
getDelegate
protected org.springframework.web.servlet.LocaleResolver getDelegate() -
resolveLocale
- Specified by:
resolveLocalein interfaceorg.springframework.web.servlet.LocaleResolver
-
setLocale
public void setLocale(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Locale locale) - Specified by:
setLocalein interfaceorg.springframework.web.servlet.LocaleResolver
-