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": "ذخیره",