fix(project): correct translation bundle shape so labels localize#12
Merged
Conversation
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>
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.
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:fieldskey instead ofobjects.<obj>.fields.<field>labelPluralinstead ofpluralLabelappssection → app name + nav untranslatedlocalekeyFix
Restructure
en.tsandzh-CN.tsto properTranslationData: nest fields under their object, rename topluralLabel, addapps.pm(label + navigation), droplocale, and type both asTranslationDataso the shape is enforced going forward.Verified end-to-end
In the composed
allenvironment the app now renders Chinese:Object + field labels now localize too.
pnpm --filter @objectlab/project typecheckpasses.🤖 Generated with Claude Code