i18n: localize dashboard metric labels across 18 locales

Replace hardcoded Peak/Avg/Free/open sockets/Mihomo/CPU strings with
dashboard.* keys and fill translations for all panel languages.
This commit is contained in:
kazeyukiro committed 2026-10-01 04:27:17 +00:00
1 parent c5896bc892
commit 91a2f17b1d
19 files changed
+117 -27

No files matched your search

+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "الحالة غير متاحة",
"users": "المستخدمون",
"totalUsers": "إجمالي المستخدمين",
"enabledUsers": "المستخدمون النشطون"
"enabledUsers": "المستخدمون النشطون",
"peak": "الذروة",
"avg": "المتوسط",
"free": "متاح",
"openSockets": "مقابس مفتوحة",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "Status nicht verfügbar",
"users": "Benutzer",
"totalUsers": "Benutzer gesamt",
"enabledUsers": "Aktive Benutzer"
"enabledUsers": "Aktive Benutzer",
"peak": "Spitze",
"avg": "Mittel",
"free": "Frei",
"openSockets": "Offene Sockets",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -156,7 +156,12 @@ export default {
"unavailable": "Status unavailable",
"users": "Users",
"totalUsers": "Total users",
"enabledUsers": "Enabled users"
"enabledUsers": "Enabled users",
"peak": "Peak",
"avg": "Avg",
"free": "Free",
"openSockets": "Open sockets",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "Estado no disponible",
"users": "Usuarios",
"totalUsers": "Usuarios totales",
"enabledUsers": "Usuarios activos"
"enabledUsers": "Usuarios activos",
"peak": "Pico",
"avg": "Prom.",
"free": "Libre",
"openSockets": "Sockets abiertos",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "État indisponible",
"users": "Utilisateurs",
"totalUsers": "Utilisateurs total",
"enabledUsers": "Utilisateurs actifs"
"enabledUsers": "Utilisateurs actifs",
"peak": "Pic",
"avg": "Moy.",
"free": "Libre",
"openSockets": "Sockets ouverts",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "स्थिति उपलब्ध नहीं",
"users": "उपयोगकर्ता",
"totalUsers": "कुल उपयोगकर्ता",
"enabledUsers": "सक्रिय उपयोगकर्ता"
"enabledUsers": "सक्रिय उपयोगकर्ता",
"peak": "शिखर",
"avg": "औसत",
"free": "खाली",
"openSockets": "खुले सॉकेट",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "Status tidak tersedia",
"users": "Pengguna",
"totalUsers": "Total pengguna",
"enabledUsers": "Pengguna aktif"
"enabledUsers": "Pengguna aktif",
"peak": "Puncak",
"avg": "Rata-rata",
"free": "Tersedia",
"openSockets": "Socket terbuka",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "状態取得不可",
"users": "ユーザー",
"totalUsers": "ユーザー合計",
"enabledUsers": "有効ユーザー"
"enabledUsers": "有効ユーザー",
"peak": "ピーク",
"avg": "平均",
"free": "空き",
"openSockets": "オープン接続",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "상태 없음",
"users": "사용자",
"totalUsers": "총 사용자",
"enabledUsers": "활성 사용자"
"enabledUsers": "활성 사용자",
"peak": "최대",
"avg": "평균",
"free": "여유",
"openSockets": "열린 소켓",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "Status niedostępny",
"users": "Użytkownicy",
"totalUsers": "Łącznie użytkowników",
"enabledUsers": "Aktywni użytkownicy"
"enabledUsers": "Aktywni użytkownicy",
"peak": "Szczyt",
"avg": "Śr.",
"free": "Wolne",
"openSockets": "Otwarte gniazda",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "Status indisponível",
"users": "Usuários",
"totalUsers": "Total de usuários",
"enabledUsers": "Usuários ativos"
"enabledUsers": "Usuários ativos",
"peak": "Pico",
"avg": "Méd.",
"free": "Livre",
"openSockets": "Sockets abertos",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "Статус недоступен",
"users": "Пользователи",
"totalUsers": "Всего пользователей",
"enabledUsers": "Активные пользователи"
"enabledUsers": "Активные пользователи",
"peak": "Пик",
"avg": "Сред.",
"free": "Свободно",
"openSockets": "Открытые сокеты",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "ไม่มีสถานะ",
"users": "ผู้ใช้",
"totalUsers": "ผู้ใช้ทั้งหมด",
"enabledUsers": "ผู้ใช้ที่เปิดใช้"
"enabledUsers": "ผู้ใช้ที่เปิดใช้",
"peak": "สูงสุด",
"avg": "เฉลี่ย",
"free": "ว่าง",
"openSockets": "การเชื่อมต่อที่เปิด",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "Durum yok",
"users": "Kullanıcılar",
"totalUsers": "Toplam kullanıcı",
"enabledUsers": "Aktif kullanıcılar"
"enabledUsers": "Aktif kullanıcılar",
"peak": "Zirve",
"avg": "Ort.",
"free": "Boş",
"openSockets": "Açık soketler",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "Статус недоступний",
"users": "Користувачі",
"totalUsers": "Всього користувачів",
"enabledUsers": "Активні користувачі"
"enabledUsers": "Активні користувачі",
"peak": "Пік",
"avg": "Сер.",
"free": "Вільно",
"openSockets": "Відкриті сокети",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "Không có trạng thái",
"users": "Người dùng",
"totalUsers": "Tổng người dùng",
"enabledUsers": "Người dùng đã bật"
"enabledUsers": "Người dùng đã bật",
"peak": "Đỉnh",
"avg": "TB",
"free": "Còn trống",
"openSockets": "Kết nối đang mở",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "Create and manage Mihomo inbound listeners.",
+6 -1
View File
@@ -156,7 +156,12 @@ export default {
"unavailable": "无法获取状态",
"users": "用户",
"totalUsers": "用户总数",
"enabledUsers": "启用用户"
"enabledUsers": "启用用户",
"peak": "峰值",
"avg": "平均",
"free": "可用",
"openSockets": "打开连接",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "创建与管理 Mihomo 入站节点。",
+6 -1
View File
@@ -154,7 +154,12 @@ export default {
"unavailable": "無法获取狀態",
"users": "使用者",
"totalUsers": "使用者總数",
"enabledUsers": "啟用使用者"
"enabledUsers": "啟用使用者",
"peak": "峰值",
"avg": "平均",
"free": "可用",
"openSockets": "開啟連線",
"coreName": "Mihomo"
},
"listeners": {
"subtitle": "建立与管理 Mihomo 入站節點。",
+9 -9
View File
@@ -305,7 +305,7 @@ const Dashboard: React.FC = () => {
}}
/>
<Text strong style={{ fontSize: isMobile ? 13 : 14 }}>
Mihomo · {coreRunning ? t('dashboard.running') : t('dashboard.stoppedStatus')}
{t('dashboard.coreName')} · {coreRunning ? t('dashboard.running') : t('dashboard.stoppedStatus')}
</Text>
{data?.mihomo?.version ? (
<Tag style={{ margin: 0, borderRadius: 999 }}>{data.mihomo.version}</Tag>
@@ -346,7 +346,7 @@ const Dashboard: React.FC = () => {
value={String(cpuPct)}
unit="%"
detail={undefined}
peak={hist.cpu.length ? `PEAK ${Math.max(...hist.cpu)}%` : undefined}
peak={hist.cpu.length ? `${t('dashboard.peak')} ${Math.max(...hist.cpu)}%` : undefined}
series={hist.cpu}
color={cpuPct >= 80 ? token.colorError : accent}
isMobile={isMobile}
@@ -358,7 +358,7 @@ const Dashboard: React.FC = () => {
value={String(memPct)}
unit="%"
detail={`${formatBytes(sys?.memory?.used || 0)} / ${formatBytes(sys?.memory?.total || 0)}`}
peak={hist.mem.length ? `AVG ${Math.round((hist.mem.reduce((a, b) => a + b, 0) / hist.mem.length) * 10) / 10}%` : undefined}
peak={hist.mem.length ? `${t('dashboard.avg')} ${Math.round((hist.mem.reduce((a, b) => a + b, 0) / hist.mem.length) * 10) / 10}%` : undefined}
series={hist.mem}
color={memPct >= 80 ? token.colorError : accent}
isMobile={isMobile}
@@ -370,7 +370,7 @@ const Dashboard: React.FC = () => {
value={String(diskPct)}
unit="%"
detail={`${formatBytes(sys?.disk?.used || 0)} / ${formatBytes(sys?.disk?.total || 0)}`}
peak={sys?.disk?.total ? `FREE ${formatBytes(Math.max(0, (sys?.disk?.total || 0) - (sys?.disk?.used || 0)))}` : undefined}
peak={sys?.disk?.total ? `${t('dashboard.free')} ${formatBytes(Math.max(0, (sys?.disk?.total || 0) - (sys?.disk?.used || 0)))}` : undefined}
series={hist.disk}
color={diskPct >= 90 ? token.colorError : accent}
isMobile={isMobile}
@@ -404,7 +404,7 @@ const Dashboard: React.FC = () => {
{t('dashboard.traffic')}
</Text>
<div style={{ fontSize: 11, color: token.colorTextSecondary, marginTop: 2 }}>
{t('dashboard.uploadRate')} peak {formatRate(peakUp)} · {t('dashboard.downloadRate')} peak{' '}
{t('dashboard.uploadRate')} · {t('dashboard.peak')} {formatRate(peakUp)} · {t('dashboard.downloadRate')} · {t('dashboard.peak')}{' '}
{formatRate(peakDown)}
</div>
</div>
@@ -474,7 +474,7 @@ const Dashboard: React.FC = () => {
{conns}
</div>
<Text type="secondary" style={{ fontSize: 12 }}>
open sockets
{t('dashboard.openSockets')}
</Text>
<div style={{ marginTop: 12 }}>
<Sparkline data={hist.conns} color={accent} height={isMobile ? 48 : 64} fillOpacity={0.15} />
@@ -517,7 +517,7 @@ const Dashboard: React.FC = () => {
</Text>
<div style={{ fontWeight: 600, fontSize: isMobile ? 13 : 14 }}>{data?.mihomo?.uptime || '—'}</div>
<Text type="secondary" style={{ fontSize: 11 }}>
Mihomo
{t('dashboard.coreName')}
</Text>
</Col>
<Col xs={12} sm={6} md={5}>
@@ -528,7 +528,7 @@ const Dashboard: React.FC = () => {
{panel?.memory_used != null ? formatBytes(panel.memory_used) : '—'}
{panel?.cpu_percent != null ? (
<Text type="secondary" style={{ fontWeight: 400, marginLeft: 6, fontSize: 12 }}>
CPU {clampPct(panel.cpu_percent)}%
{t('dashboard.cpu')} {clampPct(panel.cpu_percent)}%
</Text>
) : null}
</div>
@@ -544,7 +544,7 @@ const Dashboard: React.FC = () => {
{coreRunning && core?.memory_used != null ? formatBytes(core.memory_used) : '—'}
{coreRunning && core?.cpu_percent != null ? (
<Text type="secondary" style={{ fontWeight: 400, marginLeft: 6, fontSize: 12 }}>
CPU {clampPct(core.cpu_percent)}%
{t('dashboard.cpu')} {clampPct(core.cpu_percent)}%
</Text>
) : null}
</div>