feat(i18n): add Simplified-Chinese i18n framework and localize web & desktop UI - #10900
Draft
EclipticAxis wants to merge 5 commits into
Draft
feat(i18n): add Simplified-Chinese i18n framework and localize web & desktop UI#10900EclipticAxis wants to merge 5 commits into
EclipticAxis wants to merge 5 commits into
Conversation
Add zh-CN/en message keys for the newly-localized web surfaces: composer placeholders & send states, PR-list empty states, context-window compact, sidebar search, settings section/search labels, and the branch toolbar.
Route user-facing text in the sidebar, settings nav/search, confirm dialog, composer placeholder & primary actions, context-window meter, draft hero, no-active-thread and PR-list empty states, and the branch toolbar through useI18n()/t(), replacing hardcoded English. Add a useI18n hook to subscribe components to locale changes and drop the now-unused composerPlaceholder module. Adapt affected tests to run under the English catalog.
Route the native application menu, update/startup/WSL error dialogs, splash, and in-page context menu (Copy Link/Copy Image/No suggestions) through the shared i18n singleton, and update the affected tests to assert via i18n.t().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Adds a lightweight, zero-dependency i18n framework and a Simplified-Chinese (zh-CN) localization of the web and desktop apps.
packages/shared: a smallI18nmessage catalog (en/zh-CN) with typed keys, locale switching, param interpolation, and graceful fallback (active locale -> en -> raw key). Adds a./i18nsubpath export. Default locale iszh-CN(see note below).apps/web: wires the common first-screen, sidebar, settings navigation/search, confirm dialogs, composer placeholders/status copy, draft hero, empty states, PR-list empty states, context-window meter, and branch toolbar throughuseI18n()/t(). Adds auseI18nReact hook that re-renders components on locale change.apps/desktop: localizes the native application menu, update / startup / WSL dialogs, splash banner, and context-menu copy via the sharedi18nsingleton.docs/internals/i18n.md: documents conventions (key naming, scope, lookup/fallback rules, how to add locales).Why
Provide internationalization support and a complete Simplified-Chinese UI as a foundation for upstream multi-language support. This is derived from the community fork
EclipticAxis/t3code-zh-CNand re-adapted onto the current upstream component structure (sidebars, settings, and composer were refactored since the fork's base).Impact
zh-CNlocale the app shows Chinese, and switchingi18n.setLocale("en")returns English copy.Notes / open questions for reviewers
zh-CN(per the fork's intent). The project may preferenas the default withzh-CNopt-in; happy to change based on your preference.EN / 中文switcher is intentionally not included in this PR to keep scope focused; thesetLocale+useI18nsubscription path already supports it as a follow-up.Validation
tsc --noEmitpasses forpackages/shared,apps/web, andapps/desktop.en.tsandzh-CN.tskey sets are verified identical (167 keys each).^24.