List of usage examples for org.springframework.web.servlet.i18n CookieLocaleResolver setDefaultLocale
public void setDefaultLocale(@Nullable Locale defaultLocale)
From source file:com.castlemock.war.config.MvcConfig.java
/** * Creates a locale resolver. This is used to identify which language is currently configured to be used * for a user/*w w w .j a v a 2 s .co m*/ * @return A new cookie locale resolver */ @Bean public LocaleResolver localeResolver() { final CookieLocaleResolver ret = new CookieLocaleResolver(); ret.setDefaultLocale(new Locale("en")); return ret; }
From source file:com.pavikumbhar.javaheart.springconfiguration.WebAppConfig.java
@Bean public LocaleResolver localeResolver() { final CookieLocaleResolver cookieLocaleResolver = new CookieLocaleResolver(); cookieLocaleResolver.setDefaultLocale(Locale.ENGLISH); return cookieLocaleResolver; }
From source file:org.openlmis.fulfillment.Application.java
/** * Creates new LocaleResolver./* w w w. j av a 2s . com*/ * * @return Created LocalResolver. */ @Bean public LocaleResolver localeResolver() { CookieLocaleResolver lr = new CookieLocaleResolver(); lr.setCookieName("lang"); lr.setDefaultLocale(locale); return lr; }
From source file:com.alehuo.wepas2016projekti.configuration.DevelopmentConfiguration.java
/** * Lokalisaatioevsteen asetus//from w w w .ja v a 2 s .c o m * * Oletusarvoinen lokalisaatio: fi_FI * * @return */ @Bean public CookieLocaleResolver localeResolver() { CookieLocaleResolver localeResolver = new CookieLocaleResolver(); Locale finnishLocale = new Locale.Builder().setLanguage("fi").setRegion("FI").build(); localeResolver.setDefaultLocale(finnishLocale); localeResolver.setCookieName("locale"); //Evste vanhenee tunnissa localeResolver.setCookieMaxAge(3600); return localeResolver; }