Skip to content

Commit

Permalink
fix for MID-2075 - incorrect handling of locale from session in firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Suta committed Dec 29, 2014
1 parent 0f5c644 commit 9a4d798
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -132,8 +132,13 @@ private LocaleDescriptor getSelectedLocaleDescriptor() {
return null;
}

// The second condition is a fix attempt for issue MID-2075, where firefox
// returns 'sk' as a locale from session, while other browsers return 'sk_SK'.
// This is the reason, why in firefox selected locale is ignored (the commented
// condition is not met) so we are adding second condition to overcome this issue.
for (LocaleDescriptor desc : AVAILABLE_LOCALES) {
if (locale.equals(desc.getLocale())) {
// if (locale.equals(desc.getLocale())
if (locale.equals(desc.getLocale()) || locale.getLanguage().equals(desc.getFlag())) {
return desc;
}
}
Expand Down

0 comments on commit 9a4d798

Please sign in to comment.