Skip to content
Permalink
Browse files

Fixes for i18n to get default locale from system

  • Loading branch information...
carlosbpf committed Mar 9, 2019
1 parent 121d9db commit b83e9e612081b97e2cd53d70e7655a140abc14ff
@@ -41,7 +41,7 @@ public MessageSource messageSource() {
@Bean
public LocaleResolver localeResolver(AuthenticationService authenticationService) {
SessionLocaleResolver sessionLocaleResolver = new SessionLocaleResolver();
sessionLocaleResolver.setDefaultLocale(Locale.US);
sessionLocaleResolver.setDefaultLocale(I18nUtils.DEFAULT_LOCALE);
sessionLocaleResolver.setLocaleAttributeName(I18nUtils.MEMBER_LOCALE_SESSION_IDENTIFIER);
return new MemberLocaleResolver(authenticationService, sessionLocaleResolver);
}
@@ -9,6 +9,7 @@
import org.xcolab.client.members.pojo.Member;
import org.xcolab.client.members.pojo.MessagingUserPreference;
import org.xcolab.commons.CountryUtil;
import org.xcolab.util.i18n.I18nUtils;
import org.xcolab.view.util.validation.CompareStrings;
import org.xcolab.view.util.validation.HtmlMaxLength;
import org.xcolab.view.util.validation.PasswordLength;
@@ -82,7 +83,7 @@ public UserBean(Member member) {
if(member.getDefaultLocale()!=null){
defaultLocale = member.getDefaultLocale();
}else{
defaultLocale = "en"; //TODO COLAB-2621: migrate this to a single i18n file
defaultLocale = I18nUtils.DEFAULT_LOCALE.getLanguage();
}
if(member.getPortraitFileEntryId()==null){
imageId = 0;

0 comments on commit b83e9e6

Please sign in to comment.
You can’t perform that action at this time.