Skip to content

i18n: console action-dialog param labels are untranslatable — os i18n extract skips actions[].params #3030

Description

@baozhoutao

Problem

The Setup app's Create User dialog (and every other action param dialog: Set Password, Ban User, Change Email, 2FA, OAuth register…) shows raw English param labels even when the console locale is zh-CN — "Generate temporary password", "Password (leave empty to generate)", "Require password change on first login", etc.

Root cause

The console client already resolves param translations from o.<object>._actions.<action>.params.<param>.{label,helpText,placeholder,options.*}, but the CLI extractor (os i18n extract, packages/cli/src/utils/i18n-extract.ts) never walked actions[].params, so those keys were never emitted into the generated per-locale bundles and there was nothing for translators to fill.

Fix

  • Extend collectExpectedEntries to emit param entries for object actions and top-level (global) actions:
    • inline params → label / helpText / placeholder / options.<value>;
    • field-backed params ({ field: 'email' }) → skipped unless they carry a literal override (field translations already cover them at runtime).
  • Regenerate packages/platform-objects/src/apps/translations/{en,zh-CN,ja-JP,es-ES}.{objects,metadata-forms}.generated.ts and fill the ~26 new key groups per locale (create_user, set_password, ban, change password/email, 2FA, OAuth register params + sys_jwks alg/curve fields + page variables.* form keys).
  • Re-running extract with --merge is idempotent (zero regressions on a second pass).

Verified in the showcase: with zh-CN active the Create User dialog now renders fully in Chinese.

Out of scope (follow-ups)

  • resultDialog copy (e.g. the "User Created" result dialog) has no translation slot yet.
  • _actions.<action>.description translation slot is missing.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions