refactor: directly import and use setLanguage from i18n module in login page.

This commit is contained in:
lemon07r 2025-12-22 17:34:14 -05:00
parent 8d020d83ce
commit 06327a408a
4 changed files with 3 additions and 3 deletions

0
install-and-run.bat Normal file → Executable file
View file

0
install-and-run.sh Normal file → Executable file
View file

2
package-lock.json generated
View file

@ -1,5 +1,5 @@
{
"name": "AIClient2API",
"name": "AIClient-2-API",
"lockfileVersion": 3,
"requires": true,
"packages": {

View file

@ -219,7 +219,7 @@
</div>
<script type="module">
import { initI18n, t } from './app/i18n.js';
import { initI18n, t, setLanguage } from './app/i18n.js';
import { initLanguageSwitcher } from './app/language-switcher.js';
// 初始化多语言
@ -246,7 +246,7 @@
option.addEventListener('click', (e) => {
e.stopPropagation();
const lang = option.getAttribute('data-lang');
module.setLanguage(lang);
setLanguage(lang);
switcher.querySelector('.current-lang').textContent = lang === 'zh-CN' ? '中文' : 'EN';
languageOptions.forEach(opt => opt.classList.remove('active'));
option.classList.add('active');