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
Modifier and TypeFieldDescriptionprotected org.springframework.web.servlet.LocaleResolver
The defaultLocaleResolver
-
Constructor Summary
ConstructorDescriptionDelegatingLocaleResolver
(org.springframework.web.servlet.LocaleResolver defaultLocaleResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.web.servlet.LocaleResolver
resolveLocale
(javax.servlet.http.HttpServletRequest request) void
setLocale
(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:
resolveLocale
in interfaceorg.springframework.web.servlet.LocaleResolver
-
setLocale
public void setLocale(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Locale locale) - Specified by:
setLocale
in interfaceorg.springframework.web.servlet.LocaleResolver
-