i18n: localize sidebar theme toggle, xray-status badge, and nodes menu

The sidebar theme submenu (Theme / Dark / Ultra dark) and the dashboard's
Xray status badge ("Xray is running" etc.) were hardcoded English strings.
Wire them through vue-i18n: ThemeSwitch.vue uses menu.theme/dark/ultraDark,
and XrayStatusCard.vue derives the badge text from the existing
pages.index.xrayStatus{Running,Stop,Error,Unknown} keys (status.js no
longer carries an English stateMsg field).

The "Nodes" menu item was already keyed as menu.nodes but only en-US and
fa-IR had a translation; add it to the other 11 languages, matching the
wording each file already uses for pages.nodes.title.
#4201
This commit is contained in:
MHSanaei
2026-05-10 11:55:37 +02:00
parent 444b05cac9
commit cf5767acd1
15 changed files with 33 additions and 20 deletions

View File

@@ -27,12 +27,6 @@ const XRAY_STATE_COLORS = {
error: 'red',
};
const XRAY_STATE_MESSAGES = {
running: 'Xray is running',
stop: 'Xray is stopped',
error: 'Xray error',
};
export class Status {
constructor(data) {
this.cpu = new CurTotal(0, 0);
@@ -51,7 +45,7 @@ export class Status {
this.uptime = 0;
this.appUptime = 0;
this.appStats = { threads: 0, mem: 0, uptime: 0 };
this.xray = { state: 'stop', stateMsg: '', errorMsg: '', version: '', color: '' };
this.xray = { state: 'stop', errorMsg: '', version: '', color: '' };
if (data == null) return;
@@ -73,6 +67,5 @@ export class Status {
this.appStats = data.appStats ?? this.appStats;
this.xray = { ...this.xray, ...(data.xray || {}) };
this.xray.color = XRAY_STATE_COLORS[this.xray.state] ?? 'gray';
this.xray.stateMsg = XRAY_STATE_MESSAGES[this.xray.state] ?? 'Unknown';
}
}