Repository navigation
Pascal Editor: Simplified Chinese localization (zh-CN) - #1022
Daxiongzhang wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 23b1703. Configure here.
| document.documentElement.lang = locale | ||
| localStorage.setItem(STORAGE_KEY, locale) | ||
| document.cookie = `${STORAGE_KEY}=${locale}; path=/; max-age=31536000; samesite=lax` | ||
| }, [locale]) |
There was a problem hiding this comment.
Locale persistence overwrites saved preference
Medium Severity
I18nProvider starts at en and the persist effect writes localStorage and the pascal.locale cookie on that first value before the restore effect applies the saved locale. Under React Strict Mode that default write is read back on remount, so a stored zh-CN choice can reset to English.
Reviewed by Cursor Bugbot for commit 23b1703. Configure here.
| const sidebarTabs = SIDEBAR_TABS.map((tab) => ({ | ||
| ...tab, | ||
| label: translateDisplayText(tab.label), | ||
| })) |
There was a problem hiding this comment.
Sidebar tabs use the wrong catalog
Medium Severity
Home sidebar labels go through translateDisplayText instead of the typed sidebar.* keys. Scene and Settings have no display-map entries and stay English, while Build resolves to 建筑 rather than 建模.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 23b1703. Configure here.
| }} | ||
| onMouseEnter={() => triggerSFX('sfx:menu-hover')} | ||
| title={type.label} | ||
| title={translateDisplayText(type.label)} |
There was a problem hiding this comment.
Roof UI ignores prepared translation keys
Medium Severity
ROOF_TYPE_OPTIONS now carries labelKey values, and catalogs include build.roofType, build.roofFeatures, and roof.conicalHint, but the Build tab still renders the English label plus hardcoded section copy. Roof type controls stay English in Simplified Chinese.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 23b1703. Configure here.


What does this PR do?
Adds a Simplified Chinese localization path while preserving English as the default:
I18nProviderwith an English/Simplified Chinese switch and persisted locale@pascal-app/editorSimplified Chinese localization contributed by Daxiongzhang.
中文说明
本 PR 为 Pascal Editor 增加简体中文界面,同时保留英文作为默认语言。
简体中文本地化由 Daxiongzhang 贡献。
Install and try / 安装与体验
Requires Bun
1.3.14(the version declared by this repository).git clone https://github.com/Daxiongzhang/editor.git cd editor git checkout feat/zh-cn-localization-upstream bun install --frozen-lockfile bun devOpen the local URL printed by
bun dev, then click the language icon in the top editor toolbar to switch between English and Simplified Chinese.打开
bun dev输出的本地地址,然后点击编辑器顶部工具栏中的语言图标,即可切换英文与简体中文。How to test
bun install --frozen-lockfile, thenbun dev.bun check,bun run check-types, andbun test apps/editor/lib/i18n.test.ts packages/editor/src/lib/display-text.test.tsx.Validation
bun check: passed (3,217 files; upstream warnings remain)bun run check-types: passed (13/13 tasks)bun run test: all completed packages passed except three CLI process-management tests, which cannot spawn macOSpsin the restricted execution environment (EPERM: operation not permitted, posix_spawn 'ps')Screenshots / screen recording
Not attached in this initial submission. The change retains the existing editor layout and adds localized labels and a language switch.
Checklist
bun check)mainbranch