mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #6226] [MERGED] feat(i18n): translate the log levels, access events and calendar labels #6188
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6188
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6226
Author: @n0ctal
Created: 8/16/2026
Status: ✅ Merged
Merged: 8/18/2026
Merged by: @MHSanaei
Base:
main← Head:upstream-i18n-hardcoded-strings📝 Commits (2)
b9ca4c8feat(i18n): translate the log levels, access events and calendar labels083f703fix(i18n): keep the log export language-independent and fit the translations📊 Changes
19 files changed (+234 additions, -66 deletions)
View changed files
📝
frontend/public/mockServiceWorker.js(+21 -9)📝
frontend/src/layouts/AppSidebar.tsx(+1 -1)📝
frontend/src/pages/index/IndexPage.tsx(+1 -1)📝
frontend/src/pages/index/LogModal.tsx(+6 -6)📝
frontend/src/pages/index/XrayLogModal.tsx(+19 -5)📝
frontend/src/pages/settings/GeneralTab.tsx(+4 -5)📝
internal/web/translation/ar-EG.json(+14 -3)📝
internal/web/translation/en-US.json(+14 -3)📝
internal/web/translation/es-ES.json(+14 -3)📝
internal/web/translation/fa-IR.json(+14 -3)📝
internal/web/translation/id-ID.json(+14 -3)📝
internal/web/translation/ja-JP.json(+14 -3)📝
internal/web/translation/pt-BR.json(+14 -3)📝
internal/web/translation/ru-RU.json(+14 -3)📝
internal/web/translation/tr-TR.json(+14 -3)📝
internal/web/translation/uk-UA.json(+14 -3)📝
internal/web/translation/vi-VN.json(+14 -3)📝
internal/web/translation/zh-CN.json(+14 -3)📝
internal/web/translation/zh-TW.json(+14 -3)📄 Description
Closes part of #5820.
Summary
The log-level selector, the access-log event tags, the
Sub Formatssidebar entry and the calendar choices were hardcoded English. A user on a fully translated locale still met English on the dashboard, the log modals and the settings page.Eleven keys added across all 13 locales and wired up.
Why the list is shorter than the issue's
The issue lists roughly thirty strings. I went through them against current
mainrather than by line number, and most should stay as they are:V2RayNG,Sing-box,Shadowrocket,Happ,Incy,V2Box. Product names are not translated in any locale.SNI,uTLS,ALPN,TCP,UDP,IPv4,IPv6,DNS,JSON,CLASH,ID. These are identical in every language the panel ships; a key per acronym adds 13 lines each and buys nothing.clients-export.jsonandconfig.jsonare filenames, not labels.Xray,OS,Copy) no longer exist at those lines.What was left is the genuinely translatable remainder:
pages.index.logLevel*pages.index.access*menu.subFormatspages.settings.calendar*'Copied'on the dashboard now uses the existingcopiedkey instead of a new one.Translations
English, Russian and Ukrainian are translated. The other ten locales carry the English string — the same convention those files already use, where between 4% and 9% of entries are currently untranslated English. I would rather leave a correct English fallback than guess at Farsi or Vietnamese; a native speaker can fill them in later without touching code.
Two structural changes
Both were forced, not stylistic. The calendar list and the access-event map were module-level constants, and
tonly exists inside the component:DATEPICKER_LISTis gone; the two options are built inline wheretis in scope.EVENT_LABELSbecameEVENT_KEYSandeventLabeltakest, resolving the key at render so it follows a language switch instead of freezing at import.Validation
i18n-dead-keyspasses — it caught the three access keys while they were added but not yet referenced, which is exactly what it is for.tsc --noEmitclean,eslint srcclean, and the unit suite is green (55 files, 936 tests).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.