diff --git a/view/molistar/common/js/common2.js b/view/molistar/common/js/common2.js index 7bfbeb6c..f7852814 100644 --- a/view/molistar/common/js/common2.js +++ b/view/molistar/common/js/common2.js @@ -598,9 +598,7 @@ function fuzzyMatchUpdateQueryStringParameterFun() { history.replaceState(null, null, updateQueryStringParameter(window.location.href, 'lang', langCode)); // 初始化国际化 initLocalLang(); - if (language == "ar") { - document.documentElement.setAttribute("dir", "rtl") - } + langCodeFun(langCode); } else { setTimeout(function () { console.log('ios deviceInfo', pubInfo.deviceInfo); @@ -609,16 +607,10 @@ function fuzzyMatchUpdateQueryStringParameterFun() { history.replaceState(null, null, updateQueryStringParameter(window.location.href, 'lang', langCode)); // 初始化国际化 initLocalLang(); - console.log("langCode1",langCode); - if (langCode == "ar") { - document.documentElement.setAttribute("dir", "rtl") - } + langCodeFun(langCode); } else { fuzzyMatchUpdateQueryStringParameterFun(); - console.log("langCode2",langCode); - if (langCode == "ar") { - document.documentElement.setAttribute("dir", "rtl") - } + langCodeFun(langCode); } }, 40) // 初始化国际化 @@ -629,9 +621,12 @@ function fuzzyMatchUpdateQueryStringParameterFun() { history.replaceState(null, null, updateQueryStringParameter(window.location.href, 'lang', langCode)); // 初始化国际化 initLocalLang(); - if (langCode == "ar") { - document.documentElement.setAttribute("dir", "rtl") - } + langCodeFun(langCode); + } +} +function langCodeFun(langCode) { + if (langCode == "ar") { + document.documentElement.setAttribute("dir", "rtl"); } } // 获取整条url