feat(dashboard): add Simplified Chinese (zh) translations#86
Open
whtis wants to merge 1 commit into
Open
Conversation
Add a Simplified Chinese locale to the dashboard, following the i18n pattern introduced in rmyndharis#64. Chinese is now available alongside English and Hebrew via the existing sidebar language switcher. What's included: - New `src/i18n/locales/zh.json` mirroring the structure of `en.json`, covering all pages, components, and toast messages (404 keys + a new `common.chinese` label, identical hierarchy to `en.json`) - `zh` registered in `src/i18n/index.ts` (`supportedLanguages`, `resources`) so the language detector picks up `zh-*` browsers automatically and the cycle-language button rotates through it - Language label in `Layout.tsx` switched from a binary `he`/EN ternary to a `SupportedLanguage` lookup, so adding more languages later only requires extending the map; `zh` shows as `中文` - `common.chinese` key added to `en.json` for parity with the existing `common.english` / `common.hebrew` entries No code, API, schema, or styling changes outside i18n. RTL list is unchanged (Chinese is LTR). Existing users see no behavior change unless their browser is set to `zh-*` or they pick 中文 from the sidebar. Verified: - `npm run build` passes (tsc -b clean, vite build succeeds) - `npm run lint` reports no new errors (3 pre-existing warnings) - Key parity check: `en.json` and `zh.json` have identical key sets apart from the intentional new `common.chinese` - Chinese strings present in the production bundle (verified via grep on `dist/assets/index-*.js`)
abdelrahmanmegaly-jpg
pushed a commit
to abdelrahmanmegaly-jpg/OpenWA
that referenced
this pull request
May 20, 2026
…h locale, dashboard updates)
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.
Description
Adds a Simplified Chinese (
zh) locale to the dashboard, following the i18n pattern introduced by #64. Chinese is now selectable from the sidebar language switcher alongside English and Hebrew.Type of Change
What's included
dashboard/src/i18n/locales/zh.json— new locale file mirroring the structure ofen.json. All 404 leaf keys translated; one newcommon.chineselabel added for the language menu.dashboard/src/i18n/index.ts—zhregistered insupportedLanguagesandresourcessoi18next-browser-languagedetectorpicks upzh-*browsers automatically.dashboard/src/components/Layout.tsx— replaced thehe/ EN ternary inlanguageLabelwith aRecord<SupportedLanguage, string>lookup.zhdisplays as中文. The lookup makes the next locale a single-line addition.dashboard/src/i18n/locales/en.json— addedcommon.chinese: "中文"for parity with the existingcommon.english/common.hebrewentries.Why
The Hebrew i18n PR (#64) just added the language switcher and a second locale. This drops in a Simplified Chinese translation so the Chinese-speaking community can use the dashboard without falling back to English, and to validate that the existing i18n module scales to a third language without infrastructure changes (no RTL, no font, no CSS).
How tested
npm run buildindashboard/—tsc -bclean,vite buildsucceeds.npm run lint— 0 errors, 3 pre-existing warnings unrelated to this change.en.jsonandzh.jsonhave identical key trees apart from the intentionalcommon.chineseaddition. Script:grep "审计日志\|仪表盘" dist/assets/index-*.js).Notes
fallbackLng: 'en'). Existing users see no change unless their browser iszh-*or they pick 中文 from the switcher.OpenWA,WhatsApp,BullMQ,MinIO,PostgreSQL,SQLite,Redis,S3,TypeORM,Webhook(very widely used as-is in zh-CN tech writing — translating to "网络钩子" reads worse than keeping it).Session→ 会话,Dashboard→ 仪表盘,API Key→ API 密钥,QR Code→ 二维码,Audit Logs→ 审计日志.{{count}},{{name}},{{message}}) and inline HTML (<strong>,<code>,<br/>) preserved exactly.rtlLanguagesis unchanged.Screenshots
N/A — visible change is the sidebar language button cycling to
中文and dashboard labels rendering in Chinese; reviewers can verify locally vianpm run devand clicking the language toggle.Related Issues
None.