[desktop] fix bug 53692
This commit is contained in:
parent
37d2eeefa6
commit
f0d3467545
|
@ -98,8 +98,8 @@ Common.Locale = new(function() {
|
||||||
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
|
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
|
||||||
};
|
};
|
||||||
|
|
||||||
var _requireLang = function () {
|
var _requireLang = function (l) {
|
||||||
var lang = (_getUrlParameterByName('lang') || defLang).split(/[\-_]/)[0];
|
var lang = (l || _getUrlParameterByName('lang') || defLang).split(/[\-_]/)[0];
|
||||||
currentLang = lang;
|
currentLang = lang;
|
||||||
fetch('locale/' + lang + '.json')
|
fetch('locale/' + lang + '.json')
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
|
@ -127,6 +127,12 @@ Common.Locale = new(function() {
|
||||||
l10n = json || {};
|
l10n = json || {};
|
||||||
apply && _applyLocalization();
|
apply && _applyLocalization();
|
||||||
}).catch(function(e) {
|
}).catch(function(e) {
|
||||||
|
if ( currentLang != defLang ) {
|
||||||
|
return setTimeout(function(){
|
||||||
|
_requireLang(defLang)
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
l10n = l10n || {};
|
l10n = l10n || {};
|
||||||
apply && _applyLocalization();
|
apply && _applyLocalization();
|
||||||
if ( e.message == 'loaded' ) {
|
if ( e.message == 'loaded' ) {
|
||||||
|
|
Loading…
Reference in a new issue