[desktop] fix bug 53692

This commit is contained in:
Maxim Kadushkin 2021-11-13 12:31:50 +03:00
parent 37d2eeefa6
commit f0d3467545

View file

@ -98,8 +98,8 @@ Common.Locale = new(function() {
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
};
var _requireLang = function () {
var lang = (_getUrlParameterByName('lang') || defLang).split(/[\-_]/)[0];
var _requireLang = function (l) {
var lang = (l || _getUrlParameterByName('lang') || defLang).split(/[\-_]/)[0];
currentLang = lang;
fetch('locale/' + lang + '.json')
.then(function(response) {
@ -127,6 +127,12 @@ Common.Locale = new(function() {
l10n = json || {};
apply && _applyLocalization();
}).catch(function(e) {
if ( currentLang != defLang ) {
return setTimeout(function(){
_requireLang(defLang)
}, 0);
}
l10n = l10n || {};
apply && _applyLocalization();
if ( e.message == 'loaded' ) {