use of org.springframework.web.servlet.i18n.SessionLocaleResolver in project PublicCMS-preview by sanluan.
the class ApplicationConfig method localeResolver.
@Bean
public LocaleResolver localeResolver() {
SessionLocaleResolver localeResolver = new SessionLocaleResolver();
localeResolver.setDefaultLocale(Locale.forLanguageTag(env.getProperty("cms.defaultLocale")));
return localeResolver;
}
use of org.springframework.web.servlet.i18n.SessionLocaleResolver in project FP-PSP-SERVER by FundacionParaguaya.
the class PspServerApplication method localeResolver.
@Bean
public LocaleResolver localeResolver() {
SessionLocaleResolver slr = new SessionLocaleResolver();
slr.setDefaultLocale(new Locale(DEFAULT_LANGUAGE, DEFAULT_COUNTRY));
return slr;
}
use of org.springframework.web.servlet.i18n.SessionLocaleResolver in project cas by apereo.
the class CasLocaleChangeInterceptorTests method verifyDefaultRequestForUrl.
@Test
public void verifyDefaultRequestForUrl() throws Exception {
val request = new MockHttpServletRequest();
request.setPreferredLocales(List.of(Locale.FRENCH));
request.setRequestURI("/login");
val response = new MockHttpServletResponse();
val resolver = new SessionLocaleResolver();
request.setAttribute(DispatcherServlet.LOCALE_RESOLVER_ATTRIBUTE, resolver);
val interceptor = getInterceptor(false);
interceptor.setSupportedFlows(List.of(CasWebflowConfigurer.FLOW_ID_LOGIN));
interceptor.preHandle(request, response, new Object());
assertEquals(Locale.FRENCH, resolver.resolveLocale(request));
}
use of org.springframework.web.servlet.i18n.SessionLocaleResolver in project tutorials by eugenp.
the class MvcConfig method localeResolver.
@Bean
public LocaleResolver localeResolver() {
SessionLocaleResolver slr = new SessionLocaleResolver();
slr.setDefaultLocale(Locale.US);
return slr;
}
use of org.springframework.web.servlet.i18n.SessionLocaleResolver in project irida by phac-nml.
the class IridaUIWebConfig method localeResolver.
@Bean(name = "localeResolver")
public LocaleResolver localeResolver() {
logger.debug("Configuring LocaleResolver");
SessionLocaleResolver slr = new SessionLocaleResolver();
slr.setDefaultLocale(Locale.ENGLISH);
return slr;
}
Aggregations