Add Simplified Chinese (zh-cn) translations - #2302
Open
hawchou1995 wants to merge 1 commit into
Open
hawchou1995 wants to merge 1 commit into
hawchou1995 wants to merge 1 commit into
Conversation
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.
Author
|
Since this repository's workflows run on https://github.com/hawchou1995/r2modmanPlusChs/actions?query=branch%3Ai18n%2Fzh-cn The same commit locally: |
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.
Adds a Simplified Chinese implementation of the i18n contract in
src/i18n/base, mirroring the structure of the existingenandfrpacks.What's included
src/i18n/zh-cn/**— all 15 sections translated (pages, platforms, modListStatus, banners, modals, enums): 687 message keys, typed asMessageFormat, so a missing key is a compile error instead of a silent fallback to English.src/i18n/index.ts— registers the pack and itsdatetimeFormatsentry. It shows up inavailableLocales, 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,Intlvalidity, 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 thezh-cnandenmessage trees.Verification (on this branch)
pnpm typecheck(vue-tsc --noEmit) — cleanpnpm test— 41 files, 233 tests passingNotes
modis 「模组」 andprofileis 「配置档」. The Chinese discussion on Feature: add i18n support; add Chinese language; add settings to change the language. #1332 settled on 「档案」 forprofile; happy to follow that, or any other wording, for consistency.R2Errordiagnostic strings are intentionally untouched, the same boundary as the French pack.Screenshots available on request.