Sitelet https://github.com/ebkr/r2modmanPlus/pull/2302
Skip to content

Add Simplified Chinese (zh-cn) translations - #2302

Open
hawchou1995 wants to merge 1 commit into
ebkr:developfrom
hawchou1995:i18n/zh-cn
Open

hawchou1995 wants to merge 1 commit into
ebkr:developfrom
hawchou1995:i18n/zh-cn

Conversation

@hawchou1995

Copy link
Copy Markdown

Adds a Simplified Chinese implementation of the i18n contract in src/i18n/base, mirroring the structure of the existing en and fr packs.

What's included

  • src/i18n/zh-cn/** — all 15 sections translated (pages, platforms, modListStatus, banners, modals, enums): 687 message keys, typed as MessageFormat, so a missing key is a compile error instead of a silent fallback to English.
  • src/i18n/index.ts — registers the pack and its datetimeFormats entry. It shows up in availableLocales, which the activity bar language selector enumerates, so no UI change is needed.
  • test/vitest/tests/unit/i18n/ZhCnLocalization.spec.ts — drives the real vue-i18n instance: registration, Intl validity, one representative key per section resolving to Chinese, no English fallback, placeholder interpolation, plural branch selection, @: linked messages, and a path-for-path comparison of the zh-cn and en message trees.

Verification (on this branch)

  • pnpm typecheck (vue-tsc --noEmit) — clean
  • pnpm test — 41 files, 233 tests passing

Notes

  • No behaviour changes: the fork-side extras (defaulting fresh installs to Chinese, a language entry on the settings page) are deliberately not part of this PR — the pack is the contribution. The settings entry can be a separate PR if you want one.
  • Terminology: mod is 「模组」 and profile is 「配置档」. The Chinese discussion on Feature: add i18n support; add Chinese language; add settings to change the language. #1332 settled on 「档案」 for profile; happy to follow that, or any other wording, for consistency.
  • There is also an open PR Added Chinese (zh-CN) i18n translations #2300 adding zh-CN. This one covers every section with automated parity checks rather than a partial pack, but I am happy to consolidate into whichever you would rather review — just say which.
  • R2Error diagnostic strings are intentionally untouched, the same boundary as the French pack.

Screenshots available on request.

Implements the i18n contract in src/i18n/base for Simplified Chinese,
mirroring the structure of the en and fr packs: 15 sections, 687 keys.

- src/i18n/zh-cn/** : every section translated (pages, platforms,
  modListStatus, banners, modals, enums), typed as MessageFormat, so a
  missing key is a compile error rather than a silent English fallback.
- src/i18n/index.ts : register the pack, its datetimeFormats entry, and
  expose it through availableLocales, which is what the activity bar
  language selector enumerates.
- test/vitest/tests/unit/i18n/ZhCnLocalization.spec.ts : drives the real
  vue-i18n instance; registration, Intl validity, one representative key
  per section resolving to Chinese, no English fallback, placeholder
  interpolation, plural branch selection, @: linked messages, and a
  path-for-path comparison of the zh-cn and en message trees.

Verified on this branch: pnpm typecheck clean, pnpm test 233 passed.
@CLAassistant

CLAassistant commented Oct 1, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@hawchou1995

Copy link
Copy Markdown
Author

Since this repository's workflows run on push only, the checks for this branch are on my fork (ec131cf0): typecheck ✅ and test ✅ (the build matrix is still running there).

https://github.com/hawchou1995/r2modmanPlusChs/actions?query=branch%3Ai18n%2Fzh-cn

The same commit locally: pnpm typecheck clean, pnpm test 41 files / 233 tests passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants