feat: full i18n support - all pages use Lang.t() for zh/en

This commit is contained in:
2026-07-27 20:31:41 +08:00
parent 860bc015e8
commit de58a1c42f
10 changed files with 578 additions and 282 deletions
+4 -4
View File
@@ -8,15 +8,15 @@ const Topbar = {
if (!WS.connected) {
WS._reconnectDelay = 500;
WS._connect();
Toast.show('正在重连...', 'info', 1500);
Toast.show(Lang.t('loading'), 'info', 1500);
}
});
WS.on('status', (status) => {
this._statusEl.className = `status-indicator ${status}`;
this._statusEl.querySelector('.status-text').textContent =
status === 'connected' ? '已连接' :
status === 'error' ? '连接错误' : '未连接';
status === 'connected' ? Lang.t('connected') :
status === 'error' ? Lang.t('connectionError') : Lang.t('disconnected');
});
setInterval(() => this._refreshStatus(), 5000);
@@ -28,7 +28,7 @@ const Topbar = {
const wsStatus = status.ws_clients > 0 ? 'connected' : 'disconnected';
this._statusEl.className = `status-indicator ${wsStatus}`;
this._statusEl.querySelector('.status-text').textContent =
wsStatus === 'connected' ? `已连接 (${status.ws_clients})` : '未连接';
wsStatus === 'connected' ? `${Lang.t('connected')} (${status.ws_clients})` : Lang.t('disconnected');
} catch (e) { console.error(e); }
}
};