Skip to content

feat(admin): enable shared localization runtime in God Mode - #9590

Open
bulunote wants to merge 2 commits into
makeplane:previewfrom
bulunote:agent/i18n-god-mode
Open

feat(admin): enable shared localization runtime in God Mode#9590
bulunote wants to merge 2 commits into
makeplane:previewfrom
bulunote:agent/i18n-god-mode

Conversation

@bulunote

@bulunote bulunote commented Aug 12, 2026

Copy link
Copy Markdown

Description

God Mode currently renders outside Plane's shared localization runtime, so changing the user's language in the main application does not affect common Admin controls or the document language metadata.

This change connects the Admin application to the existing @plane/i18n runtime and performs a first, deliberately bounded localization pass:

  • adds an Admin translation provider backed by Plane's shared i18n instance;
  • restores the persisted userLanguage preference and keeps document.documentElement.lang synchronized;
  • resolves common breadcrumb segments through existing translation keys;
  • reuses already-translated shared keys for common sign-in, instance setup, General settings, and workspace dialog controls;
  • adds focused regression tests for provider wiring, language synchronization, shared keys, and namespace policy.

This PR intentionally does not add an Admin-specific namespace populated with English placeholders for other locales. Admin-only copy remains unchanged until it can be translated through Plane's normal localization workflow. That keeps every locale meaningful and makes this infrastructure change independently reviewable.

Scope and non-goals

  • No API or database changes.
  • No changes to default project state names.
  • No Web or Space UI changes.
  • No deployment artifacts or self-hosting configuration changes.
  • This is not a claim that all God Mode copy is localized; it enables the shared runtime and localizes the controls that already have valid translations.

Type of change

  • New feature
  • Bug fix
  • Breaking change
  • Documentation update

Screenshots / media

The visible behavior is locale-dependent: shared God Mode breadcrumbs, form labels, actions, and accessibility labels now follow the language already selected by the user. No layout or styling changes are introduced.

Test scenarios

  1. Set userLanguage to a supported locale such as zh-CN, open God Mode, and confirm shared breadcrumbs and controls use that locale.
  2. Reload God Mode and confirm the stored locale is retained.
  3. Confirm the root document lang attribute matches the active locale after i18n initialization.
  4. Open sign-in, instance setup, General settings, and the create-workspace prompt; verify shared labels and actions are translated.
  5. Switch back to English and confirm the same controls render in English.

Verification performed

  • pnpm --filter admin test:i18n — 5 tests passed.
  • pnpm --filter admin check:types — passed.
  • pnpm --filter @plane/i18n check:sync — all 19 locales remain synchronized at 3,837 keys.
  • pnpm turbo run build --filter=admin --output-logs=errors-only — 9/9 tasks passed.
  • Changed-file Oxlint — 0 errors (7 pre-existing warnings in touched legacy forms).
  • Changed-file Oxfmt and git diff --check — passed.

References

Part of #9089.

This complements the broader hardcoded-string work in #9082 by covering the separate Admin/God Mode application and keeping this first Admin slice small enough to review independently.

Summary by CodeRabbit

  • New Features

    • Added multilingual support across admin forms, sign-in, setup, popups, buttons, labels, and accessibility text.
    • Localized admin breadcrumbs and synchronized the document language with the selected locale.
  • Tests

    • Added coverage for translation integration, breadcrumb localization, language synchronization, shared translations, and related styling.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c72218b5-80a3-4c8c-89bd-4885334e1cd0

📥 Commits

Reviewing files that changed from the base of the PR and between 3375a1c and 6eb6836.

📒 Files selected for processing (4)
  • apps/admin/app/(all)/(home)/sign-in-form.tsx
  • apps/admin/components/common/new-user-popup.tsx
  • apps/admin/components/instance/setup-form.tsx
  • apps/admin/tests/i18n-wiring.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • apps/admin/app/(all)/(home)/sign-in-form.tsx
  • apps/admin/components/instance/setup-form.tsx
  • apps/admin/tests/i18n-wiring.test.ts
  • apps/admin/components/common/new-user-popup.tsx

📝 Walkthrough

Walkthrough

The admin app now wires the shared i18n provider, synchronizes the document locale, localizes breadcrumbs and common forms, and adds tests for translation integration.

Changes

Admin internationalization

Layer / File(s) Summary
Translation runtime wiring
apps/admin/providers/..., apps/admin/package.json, apps/admin/tests/i18n-wiring.test.ts
Adds AdminTranslationProvider, synchronizes the document language, registers @plane/i18n, and tests the runtime integration.
Breadcrumb localization
apps/admin/components/common/header/..., apps/admin/tests/i18n-wiring.test.ts
Translates core breadcrumb segments and the Settings label while retaining literal provider and AI labels.
Form and popup localization
apps/admin/app/(all)/..., apps/admin/components/common/new-user-popup.tsx, apps/admin/components/instance/setup-form.tsx, apps/admin/tests/i18n-wiring.test.ts
Replaces hardcoded labels, placeholders, actions, messages, toast text, and password visibility aria labels with translation keys. Updates related input background classes and validates shared translations.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CoreProviders
  participant AdminTranslationProvider
  participant AdminHeader
  participant AdminForms
  participant Document
  CoreProviders->>AdminTranslationProvider: provide translation context
  AdminTranslationProvider->>Document: synchronize active locale
  AdminTranslationProvider->>AdminHeader: provide translation function
  AdminTranslationProvider->>AdminForms: provide translation function
  AdminHeader->>AdminHeader: translate breadcrumb labels
  AdminForms->>AdminForms: translate form and popup text
Loading

Possibly related PRs

Suggested labels: ready to merge

Suggested reviewers: sriramveeraghanta

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: enabling the shared localization runtime in the Admin application.
Description check ✅ Passed The description covers the requested sections, scope, tests, verification results, and reference issue with sufficient detail.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bulunote
bulunote marked this pull request as ready for review August 12, 2026 00:13

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/admin/app/`(all)/(home)/sign-in-form.tsx:
- Line 141: Update the className in apps/admin/app/(all)/(home)/sign-in-form.tsx
at lines 141-141 and apps/admin/components/instance/setup-form.tsx at lines
218-218, changing the invalid !bg-surface-1 utility to the Tailwind v4 suffix
form bg-surface-1!.

In `@apps/admin/components/common/new-user-popup.tsx`:
- Around line 33-36: Update the popup description text in the new-user component
by removing the extra “with” so it reads “Start your journey by creating your
first workspace.”
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e80daa42-8063-4b2a-b461-f8a291b113d6

📥 Commits

Reviewing files that changed from the base of the PR and between 1c8a60f and 3375a1c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • apps/admin/app/(all)/(dashboard)/general/form.tsx
  • apps/admin/app/(all)/(home)/sign-in-form.tsx
  • apps/admin/components/common/header/core.ts
  • apps/admin/components/common/header/index.tsx
  • apps/admin/components/common/new-user-popup.tsx
  • apps/admin/components/instance/setup-form.tsx
  • apps/admin/package.json
  • apps/admin/providers/core.tsx
  • apps/admin/providers/translation-provider.tsx
  • apps/admin/tests/i18n-wiring.test.ts

Comment thread apps/admin/app/(all)/(home)/sign-in-form.tsx Outdated
Comment thread apps/admin/components/common/new-user-popup.tsx
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.

1 participant