chore(i18n): remove dead rewards.* keys from zh-CN#1172
Open
pftom wants to merge 1 commit intonexu-io:mainfrom
Open
chore(i18n): remove dead rewards.* keys from zh-CN#1172pftom wants to merge 1 commit intonexu-io:mainfrom
pftom wants to merge 1 commit intonexu-io:mainfrom
Conversation
`rewards.badge` and `rewards.refresh` are defined only in zh-CN.ts, have no counterparts in en.ts, and are not referenced anywhere in source. Existing guard tests at apps/web/tests/home.test.tsx:322-323 and tests/web/home.test.tsx:402-403 already assert these raw keys never appear in rendered markup — confirming they are dead translations. After this change, en.ts and zh-CN.ts both expose exactly 1052 keys, restoring full locale parity.
lefarcen
approved these changes
Apr 23, 2026
Collaborator
lefarcen
left a comment
There was a problem hiding this comment.
Hi @pftom! 🎉
Wow, what a clean and thoughtful chore PR—removing dead i18n keys while carefully documenting safety and test coverage. Love the thorough verification (rg search + test assertions + key parity check) 🙌
This looks solid—no issues found. Verified no usages outside zh-CN.ts except the guard tests you mentioned. Great out-of-scope notes on type-level guards and test consolidation too.
We'll merge promptly. Questions? Push here!
Join communities:
- Feishu: https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=90emc2e9-86cd-4723-b455-ca41b70f162d
- Discord: https://discord.gg/nexu
Thanks for making Nexu better!
Nexu Team
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.
Summary
Removes two dead i18n keys from
apps/web/src/i18n/locales/zh-CN.tsthat have no counterparts inen.tsand are not referenced anywhere in source.rewards.badge→ 奖励中心rewards.refresh→ 刷新After the change,
en.tsandzh-CN.tshave exactly the same set of 1052 keys, restoring full locale parity.Why this is safe
Two pre-existing test assertions already guard that these raw key strings do not appear in rendered markup:
apps/web/tests/home.test.tsx:322-323tests/web/home.test.tsx:402-403A repo-wide search (
rg "rewards\.(badge|refresh)") finds zero positive usages outside the locale file itself and those guard assertions — so removing the translations cannot surface the keys at runtime.Test plan
rg "rewards\.badge|rewards\.refresh"outsidezh-CN.tsshows only the negative guard tests.en.ts↔zh-CN.tsis now empty in both directions (1052 keys each).pnpm lintpnpm -C apps/web typecheckpnpm test(root vitest — coverstests/web/home.test.tsx)pnpm -C apps/web test(coversapps/web/tests/home.test.tsx)Out of scope
const zhCN: typeof en) would prevent this drift in the future; deferred to a separate PR.tests/web/home.test.tsxvsapps/web/tests/home.test.tsxfiles contain near-identical guard assertions; consolidation is out of scope.Generated with the
auto-github-contributorskill.