Skip to content

fix(i18n): system-metadata translation audit — locale fallback, app/dashboard localization, coverage gaps - #1404

Merged
hotlong merged 2 commits into
mainfrom
claude/metadata-translation-audit-WAA9X
May 31, 2026
Merged

hotlong merged 2 commits into
mainfrom
claude/metadata-translation-audit-WAA9X

Conversation

@os-zhuang

@os-zhuang os-zhuang commented May 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Audit and fix of system-object metadata + server-side translations. Switching the UI language left many surfaces in English ("切换语言之后很多都不生效"), many strings were missing, and some non-English bundles contained English placeholder text ("假的翻译"). Three root causes are addressed.

1. Locale fallback (server) — the keystone fix

The metadata translation resolver (@objectstack/spec i18n-resolver) only did exact locale matching, so a request for zh (base language, no region) fell back to English instead of hitting the registered zh-CN bundle. pickData now resolves the requested locale against the locales actually present in the bundle (exact → case-insensitive → base-language → variant), mirroring resolveLocale in @objectstack/core. This benefits every resolver (objects, views, actions, settings, metadata-forms) — the single highest-leverage fix for "switching language doesn't take effect".

2. App & dashboard localization (server)

App labels, sidebar/navigation group labels, and dashboard titles/widgets were never localized at the REST /meta boundary even though the translation data existed. Added translateApp / translateDashboard resolvers and wired app/dashboard into the REST translation path (TRANSLATABLE_META_TYPES).

3. Coverage & quality (data)

  • Added translations for the previously untranslated platform objects sys_share_link, sys_view_definition, sys_metadata_audit across en/zh-CN/ja-JP/es-ES (label, fields, help, picklist options, views) — they were absent from every bundle.
  • Registered those three objects in the i18n-extract config so future os i18n extract runs keep them (root cause: they were never in the extraction set).
  • Replaced English placeholder strings left in the zh-CN/ja-JP/es-ES object and metadata-form bundles — notably action confirmText / successMessage confirmation prompts and the new objects' picklist option labels.
  • Added the missing es-ES built-in Settings bundle in @objectstack/service-settings (loaded automatically by the settings plugin; verified structurally identical to en).

Remaining identical leaves across locales are intentional exceptions (acronyms / loanwords / format hints: URL, Token, Webhook, API, snake_case, GET / POST / …, and Spanish-identical words like Actor/Error/Global).

Tests

  • New resolver tests: BCP-47 locale fallback (zh→zh-CN, case-insensitive, variant), translateApp (nested navigation), translateDashboard.
  • @objectstack/spec 6616 passing · @objectstack/rest 78 · @objectstack/platform-objects 78 · @objectstack/service-settings 78.
  • Full monorepo build green (63/63 packages).

Notes

⚠️ Known unrelated CI failure (not introduced by this PR)

Test Core fails on packages/objectql/src/metadata-validation-sweep.test.ts — the workflow sweep fixture (sweep_wf) still uses the old workflow shape (triggerType/criteria/objectName) and fails the new state-machine workflow schema (id/initial/states) introduced in #1398 / #1403. The fixture is byte-identical between main (fa64f4b) and this branch — this PR does not touch packages/objectql. It surfaces here only because Test Core runs when a PR touches a "core" package (this one touches spec), whereas translation/UI-only PRs skip it. To be fixed separately in a workflow-focused change. (The driver-mongodb red check is an environment-only blocked binary download.)

claude added 2 commits May 31, 2026 02:36
Server-side metadata translation root-cause fixes:

- i18n-resolver: resolve the requested locale against the locales present
  in the bundle (exact → case-insensitive → base-language → variant) so a
  request for `zh` hits the `zh-CN` bundle instead of falling back to
  English. Benefits every resolver (objects/views/actions/settings/forms).
- Add translateApp / translateDashboard and wire `app`/`dashboard` into the
  REST `/meta` translation path so app labels, navigation/sidebar group
  labels, and dashboard titles/widgets are localized at the API boundary.
- service-settings: add the missing es-ES built-in Settings bundle.
- i18n-extract.config: register sys_share_link, sys_view_definition and
  sys_metadata_audit so future extractions include them.

https://claude.ai/code/session_01ASWzynvrsx5WRU2fUR116h
…rings

- Add translations for sys_share_link, sys_view_definition and
  sys_metadata_audit across en/zh-CN/ja-JP/es-ES (label, fields, help,
  picklist options, views) — previously absent from every bundle.
- Translate English placeholder strings left in the zh-CN/ja-JP/es-ES
  object and metadata-form bundles: action confirmText/successMessage
  prompts, permission-set field labels/help, picklist option labels for
  the new objects, and metadata-type form labels.
- Remaining identical leaves are intentional (acronyms/loanwords/format
  hints: URL, Token, Webhook, API, snake_case, GET/POST/..., and
  Spanish-identical words like Actor/Error/Global).

https://claude.ai/code/session_01ASWzynvrsx5WRU2fUR116h
@vercel

vercel Bot commented May 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment May 31, 2026 2:49am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation protocol:system tests tooling size/xl labels May 31, 2026
@hotlong
hotlong marked this pull request as ready for review May 31, 2026 04:22
@hotlong
hotlong merged commit 07c35d8 into main May 31, 2026
11 of 12 checks passed
@github-actions
github-actions Bot deleted the claude/metadata-translation-audit-WAA9X branch September 7, 2026 04:49

This branch was successfully deployed

1 active deployment
Preview — ad7cf163 Deployed May 31, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants