dont set default locale in user.ui and use first browser locale by default if available and fall back to site default after that, fixes #1578; load locale from unjoined json files in debug mode
This commit is contained in:
parent
24afe66c75
commit
5489823a61
7 changed files with 29 additions and 10 deletions
|
|
@ -1734,11 +1734,23 @@ pandora.selectList = function() {
|
|||
};
|
||||
|
||||
pandora.setLocale = function(locale, callback) {
|
||||
Ox.setLocale(
|
||||
locale,
|
||||
locale && locale != 'en' ? '/static/json/locale.' + locale + '.json' : null,
|
||||
callback
|
||||
);
|
||||
var url;
|
||||
// language from http header might not be supported,
|
||||
// fall back to site default
|
||||
if (Ox.isUndefined(Ox.LOCALE_NAMES[locale])) {
|
||||
locale = pandora.site.site.locale;
|
||||
}
|
||||
if (locale != 'en') {
|
||||
if (pandora.localStorage('enableDebugMode')) {
|
||||
url = [
|
||||
'/static/json/locale.pandora.' + locale + '.json',
|
||||
'/static/json/locale.' + pandora.site.site.id + '.' + locale + '.json',
|
||||
];
|
||||
} else {
|
||||
url = '/static/json/locale.' + locale + '.json'
|
||||
}
|
||||
}
|
||||
Ox.setLocale(locale, url, callback);
|
||||
};
|
||||
|
||||
pandora.unloadWindow = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue