feat: full i18n support - all pages use Lang.t() for zh/en
This commit is contained in:
@@ -49,7 +49,7 @@ const Sidebar = {
|
||||
this._gameListEl.innerHTML = '';
|
||||
|
||||
if (!Array.isArray(games) || games.length === 0) {
|
||||
this._gameListEl.innerHTML = '<div style="padding:8px 12px;color:var(--text-tertiary);font-size:12px;">暂无可用的游戏插件</div>';
|
||||
this._gameListEl.innerHTML = '<div style="padding:8px 12px;color:var(--text-tertiary);font-size:12px;">' + Lang.t('noGamePlugins') + '</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ const Sidebar = {
|
||||
return;
|
||||
}
|
||||
}
|
||||
this._gameLabelEl.textContent = '选择游戏';
|
||||
this._gameLabelEl.textContent = Lang.t('selectGame');
|
||||
},
|
||||
|
||||
async _selectGame(gameId) {
|
||||
|
||||
@@ -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); }
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user