Skip to content

feat: Add Chinese (zh-CN) localization#200

Open
2832599985 wants to merge 1 commit intosiddharthvaddem:mainfrom
2832599985:main
Open

feat: Add Chinese (zh-CN) localization#200
2832599985 wants to merge 1 commit intosiddharthvaddem:mainfrom
2832599985:main

Conversation

@2832599985
Copy link

Summary

  • Add full Chinese (zh-CN) localization via react-i18next with English fallback
  • Localize Electron native menus (File/Edit/View/Window → 文件/编辑/视图/窗口)
  • Localize system tray menu (Open/Quit/Stop Recording → 打开/退出/停止录制)
  • Localize unsaved changes dialog
  • Add src/i18n.ts config and locale files (src/locales/zh-CN.json, src/locales/en.json)

Test plan

  • Run npm run dev, verify menu bar shows Chinese labels on Windows
  • Right-click tray icon, verify Chinese menu items
  • Close editor with unsaved changes, verify Chinese dialog
  • Switch browser language to English, verify English fallback works

- 前端组件通过 react-i18next 实现中英双语支持
- Electron 原生菜单栏汉化(文件/编辑/视图/窗口)
- 系统托盘菜单汉化(打开/退出/停止录制)
- 未保存变更对话框汉化
- 新增 i18n 配置和中英文语言包
Comment on lines +120 to +128
label: "文件",
submenu: [
{
label: "Load Project…",
label: "加载项目…",
accelerator: "CmdOrCtrl+O",
click: () => sendEditorMenuAction("menu-load-project"),
},
{
label: "Save Project…",
label: "保存项目…",
Copy link
Owner

Choose a reason for hiding this comment

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

Why are all off this is in Chinese? Shouldn't you be localizing them?

Copy link
Owner

Choose a reason for hiding this comment

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

Also this is probably not the best way to do it, as you'd want to add more languages. That convolutes the main.ts file.

Copy link
Owner

Choose a reason for hiding this comment

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

Only should be seeing them in the locale file of the language you are trying to add.

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