Example usage for org.springframework.web.servlet.i18n CookieLocaleResolver setDefaultLocale

List of usage examples for org.springframework.web.servlet.i18n CookieLocaleResolver setDefaultLocale

Introduction

In this page you can find the example usage for org.springframework.web.servlet.i18n CookieLocaleResolver setDefaultLocale.

Prototype

public void setDefaultLocale(@Nullable Locale defaultLocale) 

Source Link

Document

Set a fixed locale that this resolver will return if no cookie found.

Usage

From source file:com.uimirror.auth.conf.DispatcherConfig.java

@Bean(name = "localeResolver")
public LocaleResolver sessionLocaleResolver() {
    CookieLocaleResolver localeResolver = new CookieLocaleResolver();
    localeResolver.setDefaultLocale(new Locale("en"));
    localeResolver.setCookieName("uim_locale");
    localeResolver.setCookieMaxAge(36000);
    return localeResolver;
}

From source file:com.nkapps.billing.configs.MvcConfig.java

@Bean
public LocaleResolver localeResolver() {
    CookieLocaleResolver clr = new CookieLocaleResolver();
    clr.setDefaultLocale(new Locale("ru"));
    return clr;/* w  ww .  jav  a  2s  .c  o m*/
}

From source file:org.oruko.dictionary.DictionaryApplication.java

@Bean
public LocaleResolver localeResolver() {
    CookieLocaleResolver cookieLocaleResolver = new CookieLocaleResolver();
    cookieLocaleResolver.setDefaultLocale(Locale.ENGLISH);
    return cookieLocaleResolver;
}

From source file:rashjz.info.com.az.config.SpringWebConfig.java

@Bean
public LocaleResolver localeResolver() {
    CookieLocaleResolver resolver = new CookieLocaleResolver();
    resolver.setDefaultLocale(new Locale("en"));
    resolver.setCookieName("myLocaleCookie");
    resolver.setCookieMaxAge(4800);//from w ww  . j  a  v  a2  s . com
    return resolver;
}

From source file:com.isalnikov.config.web.WebConfig.java

@Bean
public LocaleResolver localeResolver() {
    CookieLocaleResolver localeResolver = new CookieLocaleResolver();
    localeResolver.setDefaultLocale(new Locale("ru")); // change this Locale.ENGLISH)
    localeResolver.setCookieName("terminal_cookie");
    localeResolver.setCookieMaxAge(60 * 30);
    return localeResolver;
}

From source file:pl.java.scalatech.config.I18nConfig.java

@Bean
public LocaleResolver localeResolver() {
    CookieLocaleResolver clr = new CookieLocaleResolver();
    log.info("++++ language : ", env.getProperty("language"));
    clr.setDefaultLocale(Locale.forLanguageTag(env.getProperty("language")));
    return clr;/*from   w  ww.j a v  a2s .com*/
}

From source file:com.redhat.rhtracking.config.WebConfig.java

@Bean
public LocaleResolver localeResolver() {
    CookieLocaleResolver cookieLocaleResolver = new CookieLocaleResolver();
    cookieLocaleResolver.setDefaultLocale(StringUtils.parseLocaleString("en"));
    return cookieLocaleResolver;
}

From source file:com.aspose.showcase.qrcodegen.web.config.WebAppConfig.java

@Bean
public LocaleResolver localeResolver() {

    CookieLocaleResolver cookieLocaleResolver = new CookieLocaleResolver();
    cookieLocaleResolver.setDefaultLocale(StringUtils.parseLocaleString("en"));
    return cookieLocaleResolver;
}

From source file:cz.muni.fi.editor.webapp.config.MvcConfiguration.java

@Bean(name = "localeResolver")
public CookieLocaleResolver cookieLocaleResolver() {
    CookieLocaleResolver cookieLocaleResolver = new CookieLocaleResolver();
    cookieLocaleResolver.setDefaultLocale(Locale.ENGLISH);

    return cookieLocaleResolver;
}

From source file:com.MockGatewayApplication.java

@Bean
public LocaleResolver localeResolver() {
    CookieLocaleResolver cookieLocaleResolver = new CookieLocaleResolver();
    cookieLocaleResolver.setDefaultLocale(StringUtils.parseLocaleString("en"));
    cookieLocaleResolver.setCookieName("gatewayLanguage");
    cookieLocaleResolver.setCookieMaxAge(604800);//one month
    return cookieLocaleResolver;
}