mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #5820] [Feature]: Complete frontend i18n coverage — eliminate ~30 hardcoded strings to attract more international users #4044
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#4044
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?
Originally created by @ghost on GitHub (Jul 5, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5820
Is your feature request related to a problem?
The 3x-ui frontend already ships 13 translation files (2,071 keys each) and has i18next fully wired up. But the dashboard, log modals, sidebar, sub page and some form labels still have ~30 user-visible strings hardcoded in English (Statistic titles, table headers, protocol labels, etc.). So even with a complete zh-CN or pt-BR translation file, users of those languages still see mixed English on core screens.
This is a quick gap to close — the i18n engine is already there, just not fully used.
Describe the solution you'd like
Wrap the remaining hardcoded strings in
t('key')and add corresponding keys to the translation files. Below is the full list — each entry is a direct code change, no design or architecture decisions needed.P0 — Dashboard overview page (
frontend/src/pages/index/IndexPage.tsx)'Copied't('copied')title="Xray"t('pages.index.xrayStatus')title="OS"'pages.index.os'title="IPv4"'pages.index.ipv4'title="IPv6"'pages.index.ipv6'title="TCP"'pages.index.tcp'title="UDP"'pages.index.udp''Download'/'config.json''Copy't('copy')P1 — Log modals & sidebar
LogModal.tsxDebug,Info,Warning,Errorlog levelsLogModal.tsx'SysLog'XrayLogModal.tsxDIRECT,BLOCKED,PROXYevent labelsXrayLogModal.tsxDateFromToInboundOutboundEmailXrayLogModal.tsx'No Record...'AppSidebar.tsx'Sub Formats','DNS'sidebar labels...Labelto avoid namespace conflict)P1 — Sub page & settings
SubPage.tsxV2RayNG,Sing-box, etc.)SubPage.tsxSUB,JSON,CLASHtag labelsGeneralTab.tsxGregorian (Standard),JalalianuseInboundColumns.tsxtitle: 'ID''pages.inbounds.id'P2 — Form labels
reality.tsxlabel="uTLS"tls.tsxSNI,uTLS,None,ALPNFallbacksCard.tsxprefix="SNI"t('pages.inbounds.form.serverNameIndication')InboundFormModal.tsxt()ClientsPage.tsxfileName: 'clients-export.json'TestResultPopover.tsx'failed'每个改动都是
s/硬编码字符串/{t('key')}/的模式,无副作用。Why this matters
Chinese users are a major part of this panel's audience. The zh-CN translation file already has 2,071 keys ready — but those ~30 hardcoded strings still show in English, making the UI feel half-translated. Same for Russian, Portuguese, Persian, and all other supported languages.
Filling these gaps is the last step to make the panel feel fully localized for every language we already support.
Which parts of the panel would this affect?
Before submitting
@github-actions[bot] commented on GitHub (Jul 5, 2026):
I checked the specifics against the current
mainsource and the claims here largely hold up.Confirmed:
internal/web/translation/(en-US.json+ 12 others), each with 2071 scalar keys (verified withjq '[paths(scalars)] | length'onen-US.json,pt-BR.json,zh-CN.json,fa-IR.json,ru-RU.json— all identical).frontend/src/pages/index/IndexPage.tsxis hardcoded as described:'Copied'(line 160),title="Xray"(312),title="OS"(319),title="IPv4"(427),title="IPv6"(434),title="TCP"(448),title="UDP"(455),'Copy'(537), and the'Download'/'config.json'footer button text (528).t('copied')andt('copy')do already resolve to"Copied"/"Copy", andt('pages.index.xrayStatus')already resolves to"Xray"— those three are indeed just a swap, no new key needed.AppSidebar.tsxlines 184/192 ('Sub Formats','DNS'),LogModal.tsxlines 111-115 (log level labels — plus'SysLog'at line 122, not listed in the issue, same problem),XrayLogModal.tsxline 27 (EVENT_LABELS) and lines 230-235 (table headers, also'No Record...'at 187),useInboundColumns.tsxline 79 (title: 'ID'),SubPage.tsxlines 195-217 (client app labels),GeneralTab.tsxlines 37-38,reality.tsxline 56,tls.tsxlines 39/68/72/77,FallbacksCard.tsxline 100,ClientsPage.tsxline 602,TestResultPopover.tsxlines 41/63, andInboundFormModal.tsxline 98 (PROTOCOL_OPTIONSlabels taken straight from theProtocolsenum values).One correction to the suggested keys:
pages.settings.subFormatsandpages.xray.dnsare already existing namespace objects (e.g.pages.xray.dns.enable,pages.xray.dns.strategy, …), not leaf strings, so those exact paths can't be reused as scalar keys — new leaf names will be needed there (e.g. something likepages.settings.subFormatsLabel/pages.xray.dnsLabel) to avoid colliding with the existing objects.No
eslint-plugin-i18nor comparable rule is currently configured infrontend/eslint.config.js, consistent with the issue's "Alternatives" section.Given the source matches the report and you've already volunteered to implement it, this is ready for a PR. A couple of process notes from
CONTRIBUTING.mdand this repo's conventions that will apply here:en-US.json— missing keys silently fall back to English/raw key rather than failing the build.//line comments in committed frontend code per repo convention; that shouldn't affect this change since it's just string/key swaps.This reply was generated automatically; a maintainer may follow up.
@oraysercan commented on GitHub (Aug 27, 2026):
Thanks for documenting the remaining strings in detail. We’re working on Contentrain Normalize, which detects hardcoded UI content and generates a reviewable extraction plan for existing codebases.
https://contentrain.io/
This issue looks like a useful small validation case. Would the maintainers be open to us running a dry-run against the frontend and sharing the detected strings and proposed changes here before preparing a PR?