From f0d3467545aab410bd146d6f73a58534ec53508b Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Sat, 13 Nov 2021 12:31:50 +0300 Subject: [PATCH] [desktop] fix bug 53692 --- apps/common/locale.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/common/locale.js b/apps/common/locale.js index abed04e94..a18496818 100644 --- a/apps/common/locale.js +++ b/apps/common/locale.js @@ -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' ) {