feat(settings): add i18n support and translate settings UI to zh-CN#517
feat(settings): add i18n support and translate settings UI to zh-CN#517huahai0202 wants to merge 4 commits intoDimillian:mainfrom
Conversation
22cee3a to
5dc8ca6
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
c5e1d13 to
aafdec8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aafdec89d9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (zh) { | ||
| const translatedFallback = FEATURE_DESCRIPTION_FALLBACKS_ZH[feature.name]; | ||
| if (translatedFallback) { | ||
| return translatedFallback; | ||
| } |
There was a problem hiding this comment.
Use backend feature copy before zh fallback descriptions
In featureSubtitle, the new zh-CN branch returns FEATURE_DESCRIPTION_FALLBACKS_ZH before checking feature.description/feature.announcement, so zh users no longer see server-provided feature messaging for known flags. This regresses behavior from the previous implementation and can hide updated rollout/deprecation details that Codex sends dynamically; the localized fallback should only apply when backend description fields are empty.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6a05720a5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (zh) { | ||
| const translatedLabel = FEATURE_LABELS_ZH[feature.name]; | ||
| if (translatedLabel) { | ||
| return translatedLabel; | ||
| } |
There was a problem hiding this comment.
Prefer backend display names before zh label fallbacks
In zh-CN, formatFeatureLabel returns the hardcoded FEATURE_LABELS_ZH entry before checking feature.displayName, so known flags no longer surface server-provided names. This is a regression from prior behavior and can hide backend renames or rollout messaging for those flags; the localized label should be used only when displayName is absent.
Useful? React with 👍 / 👎.
|
FYI, thanks a lot for this, but I'm not sure I want to have and support localization in this app. As a maintainer of a lot of other open source projects I know this bring a lot of work for me and associated localization maintainers. |
|
Thanks for the feedback — totally understood. I know localization adds long-term maintenance cost. I’m happy to close this PR if you prefer. Really appreciate your review and your work maintaining the project. |

Overview
uiLanguage(system | en | zh-CN), with backward compatibility between frontend and backend configsChanges
Added
src/i18n/*:index.ts/provider.tsx/useI18n.ts/types.tslocales/en.ts/locales/zh-CN.tsindex.test.tsIntegrated
I18nProviderinsrc/App.tsxAdded
uiLanguageto both frontend and Rust settings models, including default value and normalization compatibilitySettingsFeaturesSectionpriority fixed: backenddisplayName/description/announcementnow overrides local fallbackAdded
hasKeyto support safe fallback for dynamic keys (prevents showing raw keys when missing)Verification
npm run typechecknpm run test -- src/i18n/index.test.ts src/features/settings/componentsNotes