Skip to content

fix(project): correct translation bundle shape so labels localize#12

Merged
xuyushun441-sys merged 1 commit into
mainfrom
fix/project-translation-shape
Jun 1, 2026
Merged

fix(project): correct translation bundle shape so labels localize#12
xuyushun441-sys merged 1 commit into
mainfrom
fix/project-translation-shape

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

Found during business-user testing (zh-CN)

The project (pm) app's name stayed "Project Management" in a Chinese console, and field/plural labels didn't localize.

Root cause: the translation bundles didn't match TranslationData, so misplaced keys were silently stripped at build:

  • field labels under a top-level fields key instead of objects.<obj>.fields.<field>
  • labelPlural instead of pluralLabel
  • no apps section → app name + nav untranslated
  • a stray top-level locale key

Fix

Restructure en.ts and zh-CN.ts to proper TranslationData: nest fields under their object, rename to pluralLabel, add apps.pm (label + navigation), drop locale, and type both as TranslationData so the shape is enforced going forward.

Verified end-to-end

In the composed all environment the app now renders Chinese:

Before After
Project Management AI 项目管理
Projects / Milestones / Risks / Issues / Resources 项目 / 里程碑 / 风险 / 问题 / 资源

Object + field labels now localize too. pnpm --filter @objectlab/project typecheck passes.

Remaining minor polish (separate): view-tab labels ("All Projects", "Project Board") and object descriptions need a views translation section.

🤖 Generated with Claude Code

The project (pm) template's translation bundles did not match `TranslationData`,
so most labels silently fell back to English (the app name stayed "Project
Management" in a zh-CN console):

- field labels were under a top-level `fields` key instead of
  `objects.<obj>.fields.<field>` → never applied;
- plural labels used `labelPlural` instead of `pluralLabel` → never applied;
- there was no `apps` section → app name + nav were untranslated;
- a stray top-level `locale` key (not part of TranslationData).

Restructure both en.ts and zh-CN.ts to proper `TranslationData`: nest fields
under their object, rename to `pluralLabel`, add `apps.pm` (label + navigation),
and drop `locale`. Type both as `TranslationData` so the shape is enforced.

Verified in the composed `all` environment: the app now renders Chinese
(AI 项目管理 / 项目 / 里程碑 / 风险 / 问题 / 资源) with localized object and field
labels. `pnpm --filter @objectlab/project typecheck` passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@xuyushun441-sys xuyushun441-sys merged commit 482cda9 into main Jun 1, 2026
0 of 2 checks passed
@xuyushun441-sys xuyushun441-sys deleted the fix/project-translation-shape branch June 1, 2026 21:06
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