예제 #1
0
 @Bean
 public CookieLocaleResolver localeResolver() {
   CookieLocaleResolver localeResolver = new CookieLocaleResolver();
   Locale defaultLocale = new Locale("fr");
   localeResolver.setDefaultLocale(defaultLocale);
   return localeResolver;
 }
예제 #2
0
 @Bean(name = "localeResolver")
 public LocaleResolver localeResolver() {
   CookieLocaleResolver localeResolver = new CookieLocaleResolver();
   localeResolver.setCookieName("holiday_locale");
   localeResolver.setDefaultLocale(new Locale("en"));
   return localeResolver;
 }
예제 #3
0
 @Bean
 public LocaleResolver localeResolver() {
   CookieLocaleResolver localeResolver = new CookieLocaleResolver();
   localeResolver.setDefaultLocale(Locale.ENGLISH);
   localeResolver.setCookieMaxAge(604800);
   return localeResolver;
 }
예제 #4
0
 @Bean
 public LocaleResolver localeResolver() {
   CookieLocaleResolver resolver = new CookieLocaleResolver();
   resolver.setDefaultLocale(new Locale("en"));
   resolver.setCookieName("cookie_name");
   resolver.setCookieMaxAge(4800);
   return resolver;
 }
예제 #5
0
 @Bean
 public LocaleResolver localeResolver() {
   CookieLocaleResolver resolver = new CookieLocaleResolver();
   resolver.setDefaultLocale(new Locale("ru"));
   resolver.setCookieName("localeCookie");
   resolver.setCookieMaxAge(7 * 24 * 3600);
   return resolver;
 }
  @Before
  public void setup() {

    CookieLocaleResolver localeResolver = new CookieLocaleResolver();
    localeResolver.setCookieDomain("domain");

    this.mockMvc =
        standaloneSetup(new SimpleController())
            .addInterceptors(new LocaleChangeInterceptor())
            .setLocaleResolver(localeResolver)
            .build();
  }
예제 #7
0
 @Bean
 public LocaleResolver localeResolver() {
   CookieLocaleResolver localeResolver = new CookieLocaleResolver();
   localeResolver.setDefaultLocale(Locale.US);
   return localeResolver;
 }
 @Override
 public void addCookie(HttpServletResponse response, String cookieValue) {
   // Mandatory cookie modification for angular to support the locale switching on the server side.
   cookieValue = "%22" + cookieValue + "%22";
   super.addCookie(response, cookieValue);
 }