feat(i18n): translate the log levels, access events and calendar labels (#6226)

* feat(i18n): translate the log levels, access events and calendar labels

The log-level selector, the access-log event tags, the Sub Formats sidebar
entry and the calendar choices were hardcoded English, so a fully translated
locale still showed them in English on core screens.

Add eleven keys across the 13 locales and reference them. Russian and
Ukrainian are translated; the remaining locales carry the English string, the
same convention the existing files already use for untranslated entries.

Two module-level constants had to move: the calendar list and the access-event
map were built outside the component, where t is not in scope. The event map
now stores keys and resolves them at render.

* fix(i18n): keep the log export language-independent and fit the translations

Three follow-ups from review. The downloaded x-ui.log had started carrying the
translated event text, so its contents depended on the panel language and the
Russian value for PROXY contains a space in a field format whose other values
are single tokens. The export keeps DIRECT/BLOCKED/PROXY; only the on-screen
tag is translated.

The log-level select had a fixed 95px width sized for "Warning", which clips
"Предупреждение"; it now grows with its content.

The three access filters stayed English while the tags they filter became
translated, so they use the same keys.

---------

Co-authored-by: n0ctal <n0ctal@users.noreply.github.com>
This commit is contained in:
n0ctal
2026-08-18 14:43:59 +05:00
committed by GitHub
parent 2b1fe1fd02
commit 5c9268c431
19 changed files with 234 additions and 66 deletions
+14 -3
View File
@@ -112,7 +112,8 @@
"docs": "التوثيق",
"openMenu": "فتح القائمة",
"pinSidebar": "تثبيت الشريط الجانبي",
"unpinSidebar": "إلغاء تثبيت الشريط الجانبي"
"unpinSidebar": "إلغاء تثبيت الشريط الجانبي",
"subFormats": "Sub Formats"
},
"pages": {
"login": {
@@ -257,7 +258,15 @@
"healthCritical": "{list} — حرج",
"panel": "اللوحة",
"threads": "الخيوط",
"uptime": "مدة التشغيل"
"uptime": "مدة التشغيل",
"logLevelDebug": "Debug",
"logLevelInfo": "Info",
"logLevelNotice": "Notice",
"logLevelWarning": "Warning",
"logLevelError": "Error",
"accessDirect": "DIRECT",
"accessBlocked": "BLOCKED",
"accessProxy": "PROXY"
},
"inbounds": {
"totalDownUp": "إجمالي المرسل/المستقبل",
@@ -1352,7 +1361,9 @@
"pathLeadingSlash": "يجب أن يبدأ المسار بالرمز /"
},
"secretClear": "مسح",
"secretClearUndo": "تراجع عن المسح"
"secretClearUndo": "تراجع عن المسح",
"calendarGregorian": "Gregorian (Standard)",
"calendarJalalian": "Jalalian (شمسی)"
},
"xray": {
"save": "احفظ",
+14 -3
View File
@@ -112,7 +112,8 @@
"docs": "Documentation",
"openMenu": "Open menu",
"pinSidebar": "Pin sidebar",
"unpinSidebar": "Unpin sidebar"
"unpinSidebar": "Unpin sidebar",
"subFormats": "Sub Formats"
},
"pages": {
"login": {
@@ -257,7 +258,15 @@
"healthCritical": "{list} — critical",
"panel": "Panel",
"threads": "Threads",
"uptime": "Uptime"
"uptime": "Uptime",
"logLevelDebug": "Debug",
"logLevelInfo": "Info",
"logLevelNotice": "Notice",
"logLevelWarning": "Warning",
"logLevelError": "Error",
"accessDirect": "DIRECT",
"accessBlocked": "BLOCKED",
"accessProxy": "PROXY"
},
"inbounds": {
"totalDownUp": "Total Sent/Received",
@@ -1469,7 +1478,9 @@
"pathLeadingSlash": "Path must start with /"
},
"secretClear": "Clear",
"secretClearUndo": "Undo clear"
"secretClearUndo": "Undo clear",
"calendarGregorian": "Gregorian (Standard)",
"calendarJalalian": "Jalalian (شمسی)"
},
"xray": {
"save": "Save",
+14 -3
View File
@@ -112,7 +112,8 @@
"docs": "Documentación",
"openMenu": "Abrir menú",
"pinSidebar": "Fijar barra lateral",
"unpinSidebar": "Desfijar barra lateral"
"unpinSidebar": "Desfijar barra lateral",
"subFormats": "Sub Formats"
},
"pages": {
"login": {
@@ -257,7 +258,15 @@
"healthCritical": "{list} — crítico",
"panel": "Panel",
"threads": "Hilos",
"uptime": "Tiempo activo"
"uptime": "Tiempo activo",
"logLevelDebug": "Debug",
"logLevelInfo": "Info",
"logLevelNotice": "Notice",
"logLevelWarning": "Warning",
"logLevelError": "Error",
"accessDirect": "DIRECT",
"accessBlocked": "BLOCKED",
"accessProxy": "PROXY"
},
"inbounds": {
"totalDownUp": "Subidas/Descargas Totales",
@@ -1352,7 +1361,9 @@
"pathLeadingSlash": "La ruta debe comenzar con /"
},
"secretClear": "Borrar",
"secretClearUndo": "Deshacer borrado"
"secretClearUndo": "Deshacer borrado",
"calendarGregorian": "Gregorian (Standard)",
"calendarJalalian": "Jalalian (شمسی)"
},
"xray": {
"save": "Guardar configuración",
+14 -3
View File
@@ -112,7 +112,8 @@
"docs": "مستندات",
"openMenu": "باز کردن منو",
"pinSidebar": "ثابت کردن نوار کناری",
"unpinSidebar": "برداشتن تثبیت نوار کناری"
"unpinSidebar": "برداشتن تثبیت نوار کناری",
"subFormats": "Sub Formats"
},
"pages": {
"login": {
@@ -257,7 +258,15 @@
"healthCritical": "{list} — بحرانی",
"panel": "پنل",
"threads": "نخ‌ها",
"uptime": "مدت کارکرد"
"uptime": "مدت کارکرد",
"logLevelDebug": "Debug",
"logLevelInfo": "Info",
"logLevelNotice": "Notice",
"logLevelWarning": "Warning",
"logLevelError": "Error",
"accessDirect": "DIRECT",
"accessBlocked": "BLOCKED",
"accessProxy": "PROXY"
},
"inbounds": {
"totalDownUp": "دریافت/ارسال کل",
@@ -1352,7 +1361,9 @@
"pathLeadingSlash": "مسیر باید با / شروع شود"
},
"secretClear": "پاک کردن",
"secretClearUndo": "لغو پاک کردن"
"secretClearUndo": "لغو پاک کردن",
"calendarGregorian": "Gregorian (Standard)",
"calendarJalalian": "Jalalian (شمسی)"
},
"xray": {
"save": "ذخیره",
+14 -3
View File
@@ -112,7 +112,8 @@
"docs": "Dokumentasi",
"openMenu": "Buka menu",
"pinSidebar": "Sematkan bilah sisi",
"unpinSidebar": "Lepas sematan bilah sisi"
"unpinSidebar": "Lepas sematan bilah sisi",
"subFormats": "Sub Formats"
},
"pages": {
"login": {
@@ -257,7 +258,15 @@
"healthCritical": "{list} — kritis",
"panel": "Panel",
"threads": "Thread",
"uptime": "Waktu aktif"
"uptime": "Waktu aktif",
"logLevelDebug": "Debug",
"logLevelInfo": "Info",
"logLevelNotice": "Notice",
"logLevelWarning": "Warning",
"logLevelError": "Error",
"accessDirect": "DIRECT",
"accessBlocked": "BLOCKED",
"accessProxy": "PROXY"
},
"inbounds": {
"totalDownUp": "Total Terkirim/Diterima",
@@ -1352,7 +1361,9 @@
"pathLeadingSlash": "Path harus diawali dengan /"
},
"secretClear": "Hapus",
"secretClearUndo": "Batalkan hapus"
"secretClearUndo": "Batalkan hapus",
"calendarGregorian": "Gregorian (Standard)",
"calendarJalalian": "Jalalian (شمسی)"
},
"xray": {
"save": "Simpan",
+14 -3
View File
@@ -112,7 +112,8 @@
"docs": "ドキュメント",
"openMenu": "メニューを開く",
"pinSidebar": "サイドバーを固定",
"unpinSidebar": "サイドバーの固定を解除"
"unpinSidebar": "サイドバーの固定を解除",
"subFormats": "Sub Formats"
},
"pages": {
"login": {
@@ -257,7 +258,15 @@
"healthCritical": "{list} — 危険水準",
"panel": "パネル",
"threads": "スレッド",
"uptime": "稼働時間"
"uptime": "稼働時間",
"logLevelDebug": "Debug",
"logLevelInfo": "Info",
"logLevelNotice": "Notice",
"logLevelWarning": "Warning",
"logLevelError": "Error",
"accessDirect": "DIRECT",
"accessBlocked": "BLOCKED",
"accessProxy": "PROXY"
},
"inbounds": {
"totalDownUp": "総アップロード / ダウンロード",
@@ -1352,7 +1361,9 @@
"pathLeadingSlash": "パスは / で始まる必要があります"
},
"secretClear": "クリア",
"secretClearUndo": "クリアを取り消す"
"secretClearUndo": "クリアを取り消す",
"calendarGregorian": "Gregorian (Standard)",
"calendarJalalian": "Jalalian (شمسی)"
},
"xray": {
"importRules": "ルールをインポート",
+14 -3
View File
@@ -112,7 +112,8 @@
"docs": "Documentação",
"openMenu": "Abrir menu",
"pinSidebar": "Fixar barra lateral",
"unpinSidebar": "Desafixar barra lateral"
"unpinSidebar": "Desafixar barra lateral",
"subFormats": "Sub Formats"
},
"pages": {
"login": {
@@ -257,7 +258,15 @@
"healthCritical": "{list} — crítico",
"panel": "Painel",
"threads": "Threads",
"uptime": "Tempo ativo"
"uptime": "Tempo ativo",
"logLevelDebug": "Debug",
"logLevelInfo": "Info",
"logLevelNotice": "Notice",
"logLevelWarning": "Warning",
"logLevelError": "Error",
"accessDirect": "DIRECT",
"accessBlocked": "BLOCKED",
"accessProxy": "PROXY"
},
"inbounds": {
"totalDownUp": "Total Enviado/Recebido",
@@ -1352,7 +1361,9 @@
"pathLeadingSlash": "O caminho deve começar com /"
},
"secretClear": "Limpar",
"secretClearUndo": "Desfazer limpeza"
"secretClearUndo": "Desfazer limpeza",
"calendarGregorian": "Gregorian (Standard)",
"calendarJalalian": "Jalalian (شمسی)"
},
"xray": {
"importRules": "Importar regras",
+14 -3
View File
@@ -112,7 +112,8 @@
"docs": "Документация",
"openMenu": "Открыть меню",
"pinSidebar": "Закрепить боковую панель",
"unpinSidebar": "Открепить боковую панель"
"unpinSidebar": "Открепить боковую панель",
"subFormats": "Форматы подписки"
},
"pages": {
"login": {
@@ -257,7 +258,15 @@
"healthCritical": "{list} — критический уровень",
"panel": "Панель",
"threads": "Потоки",
"uptime": "Время работы"
"uptime": "Время работы",
"logLevelDebug": "Отладка",
"logLevelInfo": "Информация",
"logLevelNotice": "Уведомление",
"logLevelWarning": "Предупреждение",
"logLevelError": "Ошибка",
"accessDirect": "НАПРЯМУЮ",
"accessBlocked": "ЗАБЛОКИРОВАНО",
"accessProxy": "ЧЕРЕЗ ПРОКСИ"
},
"inbounds": {
"totalDownUp": "Отправлено/получено",
@@ -1352,7 +1361,9 @@
"pathLeadingSlash": "Путь должен начинаться с /"
},
"secretClear": "Очистить",
"secretClearUndo": "Отменить очистку"
"secretClearUndo": "Отменить очистку",
"calendarGregorian": "Григорианский (обычный)",
"calendarJalalian": "Джалали (شمسی)"
},
"xray": {
"importRules": "Импорт правил",
+14 -3
View File
@@ -112,7 +112,8 @@
"docs": "Belgeler",
"openMenu": "Menüyü aç",
"pinSidebar": "Kenar çubuğunu sabitle",
"unpinSidebar": "Kenar çubuğu sabitlemesini kaldır"
"unpinSidebar": "Kenar çubuğu sabitlemesini kaldır",
"subFormats": "Sub Formats"
},
"pages": {
"login": {
@@ -257,7 +258,15 @@
"healthCritical": "{list} — kritik",
"panel": "Panel",
"threads": "İş parçacıkları",
"uptime": "Çalışma süresi"
"uptime": "Çalışma süresi",
"logLevelDebug": "Debug",
"logLevelInfo": "Info",
"logLevelNotice": "Notice",
"logLevelWarning": "Warning",
"logLevelError": "Error",
"accessDirect": "DIRECT",
"accessBlocked": "BLOCKED",
"accessProxy": "PROXY"
},
"inbounds": {
"totalDownUp": "Toplam Gönderilen/Alınan",
@@ -1352,7 +1361,9 @@
"pathLeadingSlash": "Yol / ile başlamalıdır"
},
"secretClear": "Temizle",
"secretClearUndo": "Temizlemeyi geri al"
"secretClearUndo": "Temizlemeyi geri al",
"calendarGregorian": "Gregorian (Standard)",
"calendarJalalian": "Jalalian (شمسی)"
},
"xray": {
"save": "Kaydet",
+14 -3
View File
@@ -112,7 +112,8 @@
"docs": "Документація",
"openMenu": "Відкрити меню",
"pinSidebar": "Закріпити бічну панель",
"unpinSidebar": "Відкріпити бічну панель"
"unpinSidebar": "Відкріпити бічну панель",
"subFormats": "Формати підписки"
},
"pages": {
"login": {
@@ -257,7 +258,15 @@
"healthCritical": "{list} — критичний рівень",
"panel": "Панель",
"threads": "Потоки",
"uptime": "Час роботи"
"uptime": "Час роботи",
"logLevelDebug": "Налагодження",
"logLevelInfo": "Інформація",
"logLevelNotice": "Сповіщення",
"logLevelWarning": "Попередження",
"logLevelError": "Помилка",
"accessDirect": "НАПРЯМУ",
"accessBlocked": "ЗАБЛОКОВАНО",
"accessProxy": "ЧЕРЕЗ ПРОКСІ"
},
"inbounds": {
"totalDownUp": "Всього надісланих/отриманих",
@@ -1352,7 +1361,9 @@
"pathLeadingSlash": "Шлях має починатися з /"
},
"secretClear": "Очистити",
"secretClearUndo": "Скасувати очищення"
"secretClearUndo": "Скасувати очищення",
"calendarGregorian": "Григоріанський (звичайний)",
"calendarJalalian": "Джалалі (شمسی)"
},
"xray": {
"save": "Зберегти",
+14 -3
View File
@@ -112,7 +112,8 @@
"docs": "Tài liệu",
"openMenu": "Mở menu",
"pinSidebar": "Ghim thanh bên",
"unpinSidebar": "Bỏ ghim thanh bên"
"unpinSidebar": "Bỏ ghim thanh bên",
"subFormats": "Sub Formats"
},
"pages": {
"login": {
@@ -257,7 +258,15 @@
"healthCritical": "{list} — nguy cấp",
"panel": "Panel",
"threads": "Luồng",
"uptime": "Thời gian chạy"
"uptime": "Thời gian chạy",
"logLevelDebug": "Debug",
"logLevelInfo": "Info",
"logLevelNotice": "Notice",
"logLevelWarning": "Warning",
"logLevelError": "Error",
"accessDirect": "DIRECT",
"accessBlocked": "BLOCKED",
"accessProxy": "PROXY"
},
"inbounds": {
"totalDownUp": "Tổng tải lên/tải xuống",
@@ -1352,7 +1361,9 @@
"pathLeadingSlash": "Đường dẫn phải bắt đầu bằng /"
},
"secretClear": "Xóa",
"secretClearUndo": "Hoàn tác xóa"
"secretClearUndo": "Hoàn tác xóa",
"calendarGregorian": "Gregorian (Standard)",
"calendarJalalian": "Jalalian (شمسی)"
},
"xray": {
"importRules": "Nhập quy tắc",
+14 -3
View File
@@ -112,7 +112,8 @@
"docs": "文档",
"openMenu": "打开菜单",
"pinSidebar": "固定侧边栏",
"unpinSidebar": "取消固定侧边栏"
"unpinSidebar": "取消固定侧边栏",
"subFormats": "Sub Formats"
},
"pages": {
"login": {
@@ -257,7 +258,15 @@
"healthCritical": "{list} — 危险",
"panel": "面板",
"threads": "线程",
"uptime": "运行时间"
"uptime": "运行时间",
"logLevelDebug": "Debug",
"logLevelInfo": "Info",
"logLevelNotice": "Notice",
"logLevelWarning": "Warning",
"logLevelError": "Error",
"accessDirect": "DIRECT",
"accessBlocked": "BLOCKED",
"accessProxy": "PROXY"
},
"inbounds": {
"totalDownUp": "总上传 / 下载",
@@ -1352,7 +1361,9 @@
"pathLeadingSlash": "路径必须以 / 开头"
},
"secretClear": "清除",
"secretClearUndo": "撤销清除"
"secretClearUndo": "撤销清除",
"calendarGregorian": "Gregorian (Standard)",
"calendarJalalian": "Jalalian (شمسی)"
},
"xray": {
"importRules": "导入规则",
+14 -3
View File
@@ -112,7 +112,8 @@
"docs": "文件",
"openMenu": "開啟選單",
"pinSidebar": "固定側邊欄",
"unpinSidebar": "取消固定側邊欄"
"unpinSidebar": "取消固定側邊欄",
"subFormats": "Sub Formats"
},
"pages": {
"login": {
@@ -257,7 +258,15 @@
"healthCritical": "{list} — 危險",
"panel": "面板",
"threads": "執行緒",
"uptime": "執行時間"
"uptime": "執行時間",
"logLevelDebug": "Debug",
"logLevelInfo": "Info",
"logLevelNotice": "Notice",
"logLevelWarning": "Warning",
"logLevelError": "Error",
"accessDirect": "DIRECT",
"accessBlocked": "BLOCKED",
"accessProxy": "PROXY"
},
"inbounds": {
"totalDownUp": "總上傳 / 下載",
@@ -1352,7 +1361,9 @@
"pathLeadingSlash": "路徑必須以 / 開頭"
},
"secretClear": "清除",
"secretClearUndo": "復原清除"
"secretClearUndo": "復原清除",
"calendarGregorian": "Gregorian (Standard)",
"calendarJalalian": "Jalalian (شمسی)"
},
"xray": {
"save": "儲存",