Skip to content

feat(i18n): add missing zh-CN core translations#8910

Open
vincent067 wants to merge 1 commit intomakeplane:previewfrom
vincent067:feat/add-zh-cn-core-translation
Open

feat(i18n): add missing zh-CN core translations#8910
vincent067 wants to merge 1 commit intomakeplane:previewfrom
vincent067:feat/add-zh-cn-core-translation

Conversation

@vincent067
Copy link
Copy Markdown

@vincent067 vincent067 commented Apr 19, 2026

Add complete Chinese (Simplified) translation for core.ts which was missing from zh-CN locale. This includes sidebar navigation labels, authentication forms, password validation messages, and toast notifications.

Summary by CodeRabbit

  • New Features
    • Added Chinese (Simplified) language support for core UI elements including sidebar navigation and authentication flows, enabling users to access the app in Chinese.

Add complete Chinese (Simplified) translation for core.ts:
- Sidebar navigation labels
- Authentication forms and messages
- Password validation and error messages
- Toast notifications

Also update index.ts to include zh-CN core import.

Related to the missing core.ts file identified in zh-CN locale.
Copilot AI review requested due to automatic review settings April 19, 2026 01:38
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Alex Chen seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 2026

📝 Walkthrough

Walkthrough

Added Chinese (Simplified) locale support for core UI elements by creating a new i18n resource file with sidebar and authentication strings, then registering it as a lazily-loaded entry in the locales index.

Changes

Cohort / File(s) Summary
Locale Index Registration
packages/i18n/src/locales/index.ts
Registered core as a lazy-loaded locale entry for "zh-CN" alongside existing locale modules.
Chinese Locale Strings
packages/i18n/src/locales/zh-CN/core.ts
New file containing Chinese translations for sidebar navigation items (projects, pages, inbox, workspace, analytics, modules, favorites, upgrade) and authentication UI elements (login, signup, password reset, verification codes, error messages).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A new tongue joins the fold,
Chinese whispers, stories told,
Sidebar signs and auth's soft call,
Lazy loaded—translations for all! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is provided but lacks the structured format defined in the template, which requires sections for Type of Change, Screenshots, Test Scenarios, and References. Expand the description to follow the repository template by including Type of Change checkbox, Test Scenarios, and References sections to provide complete context for reviewers.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: adding missing zh-CN core translations to the i18n locales, which is the primary purpose of this changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/i18n/src/locales/zh-CN/core.ts (1)

7-179: Validate the locale object with satisfies ITranslation for compile-time type safety.

The zh-CN/core.ts file should explicitly validate against the ITranslation interface to catch invalid nested values at compile time. Currently, only as const is used, which preserves literal types but does not validate structure. Adding satisfies ensures all nested values conform to the translation contract without widening the types.

♻️ Proposed type-validation change
+import type { ITranslation } from "../../types/translation.ts";
+
 export default {
   sidebar: {
     projects: "项目",
@@
   },
-} as const;
+} as const satisfies ITranslation;

The project's TypeScript configuration (verbatimModuleSyntax: true) fully supports .ts extensions in type-only import statements, aligning with the coding guidelines for modern TypeScript patterns.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/i18n/src/locales/zh-CN/core.ts` around lines 7 - 179, Replace the
final "export default { ... } as const" with a compile-time validation against
the ITranslation interface: import the ITranslation type (type-only import) and
apply "satisfies ITranslation" to the exported object while keeping "as const"
so the literal types are preserved; update the default export line that
currently uses "as const" to additionally use "satisfies ITranslation" and
ensure the ITranslation identifier is imported if not already
(verbatimModuleSyntax permits a .ts type-only import).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/i18n/src/locales/zh-CN/core.ts`:
- Around line 7-179: Replace the final "export default { ... } as const" with a
compile-time validation against the ITranslation interface: import the
ITranslation type (type-only import) and apply "satisfies ITranslation" to the
exported object while keeping "as const" so the literal types are preserved;
update the default export line that currently uses "as const" to additionally
use "satisfies ITranslation" and ensure the ITranslation identifier is imported
if not already (verbatimModuleSyntax permits a .ts type-only import).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: da34333a-05b1-4456-bebd-4fe6f4944948

📥 Commits

Reviewing files that changed from the base of the PR and between 13db2f8 and 150b572.

📒 Files selected for processing (2)
  • packages/i18n/src/locales/index.ts
  • packages/i18n/src/locales/zh-CN/core.ts

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Simplified Chinese (zh-CN) core locale module and wires it into the locales registry, intended to fill missing “core” translations (sidebar + auth-related strings).

Changes:

  • Added packages/i18n/src/locales/zh-CN/core.ts with sidebar and auth translation keys.
  • Registered the zh-CN core file in packages/i18n/src/locales/index.ts for dynamic import.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/i18n/src/locales/zh-CN/core.ts Introduces a new zh-CN “core” translation bundle (sidebar/auth strings).
packages/i18n/src/locales/index.ts Adds a core loader entry for the zh-CN locale.
Comments suppressed due to low confidence (1)

packages/i18n/src/locales/index.ts:46

  • zh-CN now declares a core loader, but the translation loader never imports it: TranslationStore.importLanguageFile() only imports files listed in ETranslationFiles (translations/accessibility/editor/empty-state), and coreTranslations only contains en. As a result, ./zh-CN/core won’t be merged/used and this PR likely won’t fix missing core strings at runtime. To make this effective, either (a) include core in the files imported/merged for each language (e.g., add a CORE entry to ETranslationFiles and ensure locales[lang].core exists where applicable), or (b) statically import the zh-CN core module and add it to coreTranslations.
  "zh-CN": {
    core: () => import("./zh-CN/core"),
    translations: () => import("./zh-CN/translations"),
    accessibility: () => import("./zh-CN/accessibility"),
    editor: () => import("./zh-CN/editor"),
    "empty-state": () => import("./zh-CN/empty-state"),

Comment on lines +7 to +18
export default {
sidebar: {
projects: "项目",
pages: "页面",
new_work_item: "新工作项",
home: "主页",
your_work: "我的工作",
inbox: "收件箱",
workspace: "工作区",
views: "视图",
analytics: "分析",
work_items: "工作项",
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new zh-CN/core.ts largely duplicates keys that already exist in zh-CN/translations.ts (e.g., sidebar.*, auth.*). Keeping the same keys in two files increases drift risk (and there are already differences, like unique_code.label being "验证码" here vs "唯一码" in translations.ts). Consider consolidating so each key lives in exactly one source (either move these keys out of translations.ts into core.ts, or remove core.ts and keep them in translations.ts), and ensure the loader merges them deterministically.

Copilot uses AI. Check for mistakes.
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.

3 participants