Skip to content

feat(i18n): add Simplified Chinese reference locale - #281

Merged
ChristopherVR merged 1 commit into
ChristopherVR:mainfrom
yunfeizhu:feat/simplified-chinese-locale
Sep 14, 2026
Merged

ChristopherVR merged 1 commit into
ChristopherVR:mainfrom
yunfeizhu:feat/simplified-chinese-locale

Conversation

@yunfeizhu

Copy link
Copy Markdown
Contributor

What does this change?

Add Simplified Chinese (zh-CN) to the reference locales and all five demos. Users can select 简体中文 in File > Options > Language, see translated commands and slide counters immediately, and keep that choice after reloading.

The dictionary covers all 3,620 canonical keys, including the 300 reachable animation preset labels. It preserves every interpolation placeholder and provides Chinese demo-shell text as well. The private locale workspace exports translationsZhCN from its root and /zh-CN entry point; the localization guide explains registration in external applications.

Fixes #280

Type of change

  • New feature (non-breaking)

Cross-binding parity

Binding Implemented here? Validation
React Yes Dictionary registration, language list, demo text, live switching and persistence
Vue Yes Same, plus conversion to vue-i18n syntax and compilation of every Chinese message
Angular Yes Dictionary registration, language list, demo text, live switching and persistence
Svelte Yes Dictionary registration, language list, demo text, live switching and persistence
Vanilla Yes Dictionary registration, language list, demo text, live switching and persistence
  • Shared locale metadata lives in pptx-viewer-shared
  • Implemented in all five demos using their existing translation APIs
  • Existing English keys are covered; no new English keys are introduced

The literal-label fixes in #279 are independently reviewable. This PR adds the locale and registration; both changes together improve the translated React editor.

Keeping the locale maintainable

Add Chinese to the generator so future runs preserve its reviewed values and root export. Register the current key prefixes and split large product-area sections into bounded files; otherwise regeneration stops on prefixes already present in today's English dictionary. Running the generator preserved all 3,620 Chinese values. Existing French, Spanish, and German dictionaries are unchanged in this PR.

Testing

  • Exact key and placeholder parity, animation label coverage, and demo language/copy checks for all five bindings: 26 locale tests passed
  • Vue compiles every Chinese message and interpolates the slide counter: 6 i18n tests passed
  • Framework-neutral locale-switching spec: 10 passed across all five demos, including Chinese persistence after reload
  • Visually checked the Chinese React language dialog

Checks run locally:

  • bun run build
  • bun run lint
  • bun run fmt:check
  • bun run typecheck (no errors; five existing Svelte warnings)
  • bun run locales:generate (verified the Chinese dictionary values are preserved)
  • bun run test: nine package suites passed. The core fixture-manifest check is the only failure: nested-list-continuation.pptx is present but absent from the manifest. The same check fails with unchanged core code and fixtures at f824eb0c760b3ff1319d1cb5dd2d3e4329f0822b.
  • bun run e2e locale-switching.spec.ts --config <local-chrome-config> --workers=2: used installed Chrome on macOS; the local config retains the repository's five projects and global setup.

Conventional Commits

  • Commit messages follow Conventional Commits

@github-actions github-actions Bot added documentation Improvements or additions to documentation react React binding (pptx-react-viewer) vue Vue binding (pptx-vue-viewer) angular Angular binding (pptx-angular-viewer) svelte Svelte binding (pptx-svelte-viewer) vanilla Vanilla binding (pptx-vanilla-viewer) shared Framework-agnostic viewer logic (pptx-viewer-shared) i18n Translations and locale dictionaries e2e Playwright end-to-end suite ci Workflows, scripts, release tooling labels Sep 14, 2026
@ChristopherVR
ChristopherVR merged commit f847dd2 into ChristopherVR:main Sep 14, 2026
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

angular Angular binding (pptx-angular-viewer) ci Workflows, scripts, release tooling documentation Improvements or additions to documentation e2e Playwright end-to-end suite i18n Translations and locale dictionaries react React binding (pptx-react-viewer) shared Framework-agnostic viewer logic (pptx-viewer-shared) svelte Svelte binding (pptx-svelte-viewer) vanilla Vanilla binding (pptx-vanilla-viewer) vue Vue binding (pptx-vue-viewer)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Simplified Chinese reference locale to the five demos

2 participants