diff options
| author | Shishkevich D. <135337715+shishkevichd@users.noreply.github.com> | 2025-03-08 05:54:41 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-08 05:54:41 +0300 |
| commit | 6658f648e696712d5bca3083d613203fbb5ff2df (patch) | |
| tree | 228017738e6dccc406c3592f114e3a7d8ffbc871 /web/html | |
| parent | d6f9f3f6d3747b049de52be2e68cb9a850343307 (diff) | |
refactor: move language manager to utils (#2735)
Diffstat (limited to 'web/html')
| -rw-r--r-- | web/html/common/js.html | 1 | ||||
| -rw-r--r-- | web/html/login.html | 6 | ||||
| -rw-r--r-- | web/html/xui/settings.html | 8 |
3 files changed, 7 insertions, 8 deletions
diff --git a/web/html/common/js.html b/web/html/common/js.html index 2d93935f..1c2d64b3 100644 --- a/web/html/common/js.html +++ b/web/html/common/js.html @@ -7,7 +7,6 @@ <script src="{{ .base_path }}assets/js/axios-init.js?{{ .cur_ver }}"></script> <script src="{{ .base_path }}assets/js/util/date-util.js?{{ .cur_ver }}"></script> <script src="{{ .base_path }}assets/js/util/index.js?{{ .cur_ver }}"></script> -<script src="{{ .base_path }}assets/js/langs.js"></script> <script> const basePath = '{{ .base_path }}'; axios.defaults.baseURL = basePath; diff --git a/web/html/login.html b/web/html/login.html index 717adc56..82c9afd5 100644 --- a/web/html/login.html +++ b/web/html/login.html @@ -449,9 +449,9 @@ <a-row justify="center" class="centered"> <a-col :span="24"> <a-select ref="selectLang" v-model="lang" - @change="setLang(lang)" style="width: 200px;" + @change="LanguageManager.setLanguage(lang)" style="width: 200px;" :dropdown-class-name="themeSwitcher.currentTheme"> - <a-select-option :value="l.value" label="English" v-for="l in supportLangs"> + <a-select-option :value="l.value" label="English" v-for="l in LanguageManager.supportedLanguages"> <span role="img" aria-label="l.name" v-text="l.icon"></span> <span v-text="l.name"></span> </a-select-option> @@ -493,7 +493,7 @@ lang: "" }, async created() { - this.lang = getLang(); + this.lang = LanguageManager.getLanguage(); this.secretEnable = await this.getSecretStatus(); }, methods: { diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index 58a1bf8a..e8fa7e11 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -179,10 +179,10 @@ <template #control> <a-select ref="selectLang" v-model="lang" - @change="setLang(lang)" + @change="LanguageManager.setLanguage(lang)" :dropdown-class-name="themeSwitcher.currentTheme" style="width: 100%"> - <a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs"> + <a-select-option :value="l.value" :label="l.value" v-for="l in LanguageManager.supportedLanguages"> <span role="img" :aria-label="l.name" v-text="l.icon"></span> <span v-text="l.name"></span> </a-select-option> </a-select> @@ -344,7 +344,7 @@ <template #title>{{ i18n "pages.settings.telegramBotLanguage"}}</template> <template #control> <a-select ref="selectBotLang" v-model="allSetting.tgLang" :dropdown-class-name="themeSwitcher.currentTheme" style="width: 100%"> - <a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs"> + <a-select-option :value="l.value" :label="l.value" v-for="l in LanguageManager.supportedLanguages"> <span role="img" :aria-label="l.name" v-text="l.icon"></span> <span v-text="l.name"></span> </a-select-option> </a-select> @@ -672,7 +672,7 @@ allSetting: new AllSetting(), saveBtnDisable: true, user: {}, - lang: getLang(), + lang: LanguageManager.getLanguage(), remarkModels: { i: 'Inbound', e: 'Email', o: 'Other' }, remarkSeparators: [' ', '-', '_', '@', ':', '~', '|', ',', '.', '/'], datepickerList: [{ name: 'Gregorian (Standard)', value: 'gregorian' }, { name: 'Jalalian (شمسی)', value: 'jalalian' }], |
