mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 04:04:35 +08:00
Open rtl mode for ar lang
This commit is contained in:
@ -171,7 +171,7 @@ Common.Locale = new(function() {
|
||||
} else _requireLang();
|
||||
|
||||
const _isCurrentRtl = function () {
|
||||
return false;
|
||||
return currentLang && (/^(ar)$/i.test(currentLang));
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
@ -39,7 +39,12 @@ var checkLocalStorage = (function () {
|
||||
}
|
||||
})();
|
||||
|
||||
if ( checkLocalStorage && localStorage.getItem("ui-rtl") === '1' ) {
|
||||
if (!lang) {
|
||||
lang = (/(?:&|^)lang=([^&]+)&?/i).exec(window.location.search.substring(1));
|
||||
lang = lang ? lang[1] : '';
|
||||
}
|
||||
lang && (lang = lang.split(/[\-\_]/)[0].toLowerCase());
|
||||
if ( checkLocalStorage && localStorage.getItem("ui-rtl") === '1' || (!checkLocalStorage || localStorage.getItem("ui-rtl") === null) && lang==='ar') {
|
||||
document.body.setAttribute('dir', 'rtl');
|
||||
document.body.classList.add('rtl');
|
||||
}
|
||||
|
||||
@ -1199,7 +1199,7 @@ Common.Utils.getKeyByValue = function(obj, value) {
|
||||
|
||||
!Common.UI && (Common.UI = {});
|
||||
Common.UI.isRTL = function () {
|
||||
if ( window.isrtl == undefined ) {
|
||||
if ( window.isrtl === undefined ) {
|
||||
window.isrtl = Common.localStorage.itemExists('ui-rtl') ?
|
||||
Common.localStorage.getBool("ui-rtl") : Common.Locale.isCurrentLanguageRtl();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user