fix: drop Traditional Chinese locale support#99
Conversation
📝 WalkthroughWalkthroughThis PR removes the separate Traditional Chinese ("zht") locale and related detectors, collapses all zh-* inputs to the single Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request removes Traditional Chinese (zht) as a distinct locale, consolidating all Chinese language variants into Simplified Chinese (zh). The changes involve deleting translation files, updating locale type definitions, and refactoring detection and normalization logic across both the web and desktop applications. Review feedback identified redundant checks and potential case-sensitivity bugs in the updated normalizeLocale and parseLocale functions, where uppercase locale strings might fail to match supported values.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa90c59636
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/desktop-electron/src/renderer/i18n/index.ts`:
- Around line 30-35: The parseLocale implementation duplicates logic in
normalizeLocale—extract a single shared normalization helper (e.g., export
function normalizeLocaleShared) into a common/shared module and have both
parseLocale and the existing normalizeLocale import and delegate to that helper;
ensure the shared helper keeps the same behavior (string check, toLowerCase, zh
prefix -> "zh", membership check against LOCALES), export the Locale type or
reuse the existing type so parseLocale (and normalizeLocale in packages/app)
return the same Locale | null shape, and update imports in parseLocale and
normalizeLocale to reference the new shared function.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: e0e69682-e1d3-4172-8402-e88b73e710f9
📒 Files selected for processing (4)
packages/app/src/context/language.test.tspackages/app/src/context/language.tsxpackages/desktop-electron/src/renderer/i18n/index.test.tspackages/desktop-electron/src/renderer/i18n/index.ts
Summary
Remove Traditional Chinese as a PawWork product-supported locale. PawWork now exposes only English and Simplified Chinese in app and Electron locale surfaces, while legacy Traditional Chinese values and Traditional Chinese language tags fall back to Simplified Chinese.
Why
Traditional Chinese is a separate language support commitment, and PawWork's current product goal is to maintain only English and Simplified Chinese. This keeps localization scope smaller while preserving a reasonable fallback for existing
zhtusers andzh-Hant/zh-TW/zh-HK/zh-MOenvironments.Related Issue
None.
How To Verify
The final
rgcontent check is expected to find only compatibility code and tests for legacyzht/zh-Hant; the productzht.tsfile check should return no app or desktop files.Screenshots or Recordings
Not included. This is a locale support scope change covered by unit tests and typechecks.
Checklist
devbranchSummary by CodeRabbit