mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6960] [MERGED] fix(routing): show the Balancer label on mobile rule cards #6544
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#6544
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/6960
Author: @eric15342335
Created: 10/26/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @MHSanaei
Base:
main← Head:claude/3x-ui-xray-balancer-i18n-cb0660📝 Commits (1)
f33608bfix(routing): show the Balancer label on mobile rule cards📊 Changes
2 files changed (+13 additions, -4 deletions)
View changed files
📝
frontend/src/pages/xray/routing/RuleCardList.tsx(+1 -3)📝
frontend/src/test/i18n-dead-keys.test.ts(+12 -1)📄 Description
Summary
In windows 768 px wide or narrower, which includes phones, a routing rule that targets a balancer showed
key 'pages.xray.balancer (en-US)' returned an object instead of string.on its card in Xray Configs → Routing. The card now shows the translated "Balancer" label.Why
RuleCardList.tsxlabelled those rules witht('pages.xray.balancer') || 'Balancer'. That key is the balancer form's group of keys (.tag,.selector, …), not a string. For a group, i18next returns the "returned an object" message, and since that message is a non-empty string, the|| 'Balancer'fallback never ran. It showed in every locale. The desktop table uses a different key and wasn't affected.The card now uses
pages.xray.rules.balancer, the "Balancer" label the Balancers tab already uses. All 14 locales translate it, so no locale files change.Type of change
Areas affected
How was this tested?
frontend/src/test/i18n-dead-keys.test.ts: it collects every literalt()key in the frontend and Go sources and fails if one names a group of keys instead of a string. Before the fix it failed and listed onlypages.xray.balancer. It passes now.typecheck,lint,format:check,buildandbuild-storybookscripts pass. The Vitest unit and components projects pass (1920 tests), and so does the Storybook project (99 tests).ghcr.io/mhsanaei/3x-ui:v3.11.0image, added a routing rule that targets a balancer, and opened Xray Configs → Routing in Chromium at 375×812:Screenshots / recordings
Before:
After:
Breaking changes
None.
Checklist
go build ./...and the test suite pass locally. (No Go files changed, and there's no Go toolchain on this machine, so I didn't run them.)npm run lint,npm run typecheck, andnpm run buildpass.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
[PR #6960] fix(routing): show the Balancer label on mobile rule cardsto [PR #6960] [MERGED] fix(routing): show the Balancer label on mobile rule cards