Skip to content

feat(admin): add Chinese and English localization - #344

Open
wandaocheng1997 wants to merge 3 commits into
CoreBunch:mainfrom
wandaocheng1997:feat/admin-i18n
Open

feat(admin): add Chinese and English localization#344
wandaocheng1997 wants to merge 3 commits into
CoreBunch:mainfrom
wandaocheng1997:feat/admin-i18n

Conversation

@wandaocheng1997

@wandaocheng1997 wandaocheng1997 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add English and Simplified Chinese localization for first-party admin UI, with language controls before and after authentication and route-chunk-local translated literals.
  • Keep English as the default, as requested in review. Preserve an explicit saved Chinese preference; validate stored preferences with TypeBox, handle unavailable storage safely, and synchronize preference changes/removal across tabs.
  • Extend coverage to shared UI controls, scheduling-calendar labels, locale-aware dates/numbers, dashboard greetings, import/publish counts, accessibility labels, and newer admin screens.
  • Improve extraction for custom label props, default copy, subtitles, configuration labels, fallback errors, and JSX callback labels. Preserve JSX entity semantics without decoding ordinary JavaScript strings.
  • Keep shared primitives independent of the admin layer through a typed UI message context with English standalone defaults.
  • Document localization architecture, extension steps, and remaining coverage boundaries. Published-site language and author/plugin content are unchanged.

Verification

  • bun scripts/admin-i18n-report.ts --missing — 3,195 unique extracted messages, 0 missing across 4,356 occurrences.
  • bun run build
  • DB=sqlite DATABASE_URL=sqlite::memory: bun test — 6,753 passed, 0 failed.
  • bun run lint
  • Focused localization regression tests — 28 passed, covering defaults, persistence/storage failures, cross-tab changes, extraction, UI catalogs, and calendar behavior.
  • Desktop browser smoke checks with disposable local SQLite data: setup/login language selection, persisted Chinese preference, and dashboard/AI/media language switching.
  • git diff --check

Scope and follow-ups

  • Zero missing means zero missing translations in the extractor's supported first-party admin contexts; it is not a claim that every possible runtime string is translated.
  • Built-in module metadata under src/modules/ and persisted system table/field/role display names still need presentation-layer localization that distinguishes system metadata from author-defined names.
  • User-authored content, third-party plugin UI, and provider/compiler diagnostic details keep their original text. Browser checks are not an exhaustive audit of every modal, permission state, or editor interaction.

Checklist

  • Tests cover behavior changes.
  • Documentation was updated.
  • No compatibility shim was added.
  • No deployment configuration, secrets, local databases, uploads, or generated screenshots/build artifacts are included.

@wandaocheng1997
wandaocheng1997 marked this pull request as ready for review August 11, 2026 02:03
@DavidBabinec

Copy link
Copy Markdown
Contributor

Is this PR switching default admin UI to Chinese?

We appreciate the work, but please do not change default behaviour like that, this is breaking change for many people not speaking Chinese. Default admin UI language should remain English.

I will review the PR after tweaking it.

Thank you.

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