Fix loading not-rtl language

This commit is contained in:
Julia Radzhabova
2024-11-22 21:52:06 +03:00
parent 8a9bae00bc
commit 0daa6c5c8b

View File

@ -43,6 +43,7 @@ Common.Locale = new(function() {
_4letterLangs = ['pt-pt', 'zh-tw', 'sr-cyrl'];
var _applyLocalization = function(callback) {
_fixRtl();
try {
callback && (loadcallback = callback);
if (l10n) {
@ -160,6 +161,15 @@ Common.Locale = new(function() {
});
};
var _fixRtl = function(prop, scope) {
if (!_isCurrentRtl() && document.body.classList.contains('rtl')) {
document.body.removeAttribute('dir');
document.body.classList.remove('rtl');
document.body.classList.remove('rtl-font');
document.body.setAttribute('applang', currentLang);
}
};
if ( !window.fetch ) {
/* use fetch polifill if native method isn't supported */
var polyfills = ['../vendor/fetch/fetch.umd'];