fix(admin): translate long-tail i18n leaks in admin UI#940
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
docs | 7635c96 | May 07 2026, 02:53 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-i18n | 7635c96 | May 07 2026, 02:52 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-playground | 7635c96 | May 07 2026, 02:53 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-cache | 7635c96 | May 07 2026, 02:53 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-perf-coordinator | 7635c96 | May 07 2026, 02:52 PM |
Scope checkThis PR touches 41 files. PRs with a broad scope are harder to review. Please confirm the scope hasn't drifted beyond the intended change. If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs. See CONTRIBUTING.md for contribution guidelines. |
Overlapping PRsThis PR modifies files that are also changed by other open PRs:
This may cause merge conflicts or duplicated work. A maintainer will coordinate. |
🦋 Changeset detectedLatest commit: 7635c96 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
Wrap remaining user-facing English strings across settings panels, marketplace, sandboxed-plugin host, auth flows (Signup, Login, Passkey, DeviceAuthorize, SetupWizard), taxonomy/menu management, content editor remnants, and lib/api module-level functions. For lib/api fallback messages, uses the i18n._(msg``) pattern since module-level code can't call useLingui(). MenuList item count uses plural() which fixed an existing grammar bug (1 items -> 1 item; test regex updated).
ced937b to
348aade
Compare
The previous commit dropped the <span> wrappers around Back/Turn into/Duplicate/Delete labels when wrapping in t``. The wrappers are needed for consistent flex layout with the icon and to match the transforms-list pattern.
There was a problem hiding this comment.
Pull request overview
This PR continues the admin i18n cleanup (stacked on #937) by wrapping remaining user-facing English strings across the admin UI and admin API client fallbacks so they flow through Lingui translation instead of leaking raw English in non-English locales.
Changes:
- Wrapped additional admin UI strings in Lingui macros (
t,msg,<Trans>,plural) across settings, marketplace, sandboxed-plugin host, editors, and auth flows. - Updated module-level admin API client fallback messages to use the
i18n._(msg\`)` pattern where hooks aren’t available. - Fixed a pluralization grammar bug in
MenuList(and updated the corresponding test regex).
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/admin/tests/components/MenuList.test.tsx | Updates regex assertion to match corrected singular “1 item”. |
| packages/admin/src/lib/api/api-tokens.ts | Localizes throwResponseError fallback string. |
| packages/admin/src/lib/api/bylines.ts | Localizes throwResponseError fallback string. |
| packages/admin/src/lib/api/client.ts | Localizes manifest fetch fallback string. |
| packages/admin/src/lib/api/comments.ts | Localizes throwResponseError fallback string. |
| packages/admin/src/lib/api/content.ts | Localizes multiple content/revision fallback strings. |
| packages/admin/src/lib/api/import.ts | Localizes import-media fallback string. |
| packages/admin/src/lib/api/marketplace.ts | Localizes marketplace install/update/uninstall fallback strings. |
| packages/admin/src/lib/api/media.ts | Localizes upload/delete/provider-delete fallback strings. |
| packages/admin/src/lib/api/menus.ts | Localizes delete menu/menu item fallback strings. |
| packages/admin/src/lib/api/plugins.ts | Localizes fetch plugin fallback strings. |
| packages/admin/src/lib/api/redirects.ts | Localizes delete redirect fallback string. |
| packages/admin/src/lib/api/schema.ts | Localizes collection/field operations fallback strings. |
| packages/admin/src/lib/api/sections.ts | Localizes delete section fallback string. |
| packages/admin/src/lib/api/taxonomies.ts | Localizes delete term fallback string. |
| packages/admin/src/lib/api/users.ts | Localizes multiple user/passkey/allowed-domain fallback strings. |
| packages/admin/src/lib/api/widgets.ts | Localizes widget-area/widget delete/reorder fallback strings. |
| packages/admin/src/components/auth/PasskeyLogin.tsx | Localizes passkey login error fallbacks. |
| packages/admin/src/components/auth/PasskeyRegistration.tsx | Localizes passkey registration error fallbacks. |
| packages/admin/src/components/BlockKitFieldWidget.tsx | Localizes select placeholder and unsupported-element fallback. |
| packages/admin/src/components/ContentEditor.tsx | Localizes autosave status aria-label. |
| packages/admin/src/components/DeviceAuthorizePage.tsx | Localizes authorization failure fallback. |
| packages/admin/src/components/FieldEditor.tsx | Localizes options placeholder text. |
| packages/admin/src/components/MarketplaceBrowse.tsx | Converts sort labels to MessageDescriptors resolved at render. |
| packages/admin/src/components/MediaLibrary.tsx | Localizes “Library” tab label and updates memo deps. |
| packages/admin/src/components/MediaPickerModal.tsx | Localizes image-load errors/labels and threads translated error into probe helper. |
| packages/admin/src/components/MenuList.tsx | Fixes pluralization via <Trans> + plural() for menu item count. |
| packages/admin/src/components/Redirects.tsx | Localizes form placeholder examples. |
| packages/admin/src/components/SandboxedPluginPage.tsx | Localizes sandbox error states for plugin pages. |
| packages/admin/src/components/SandboxedPluginWidget.tsx | Localizes sandbox error/empty states for widgets. |
| packages/admin/src/components/Sections.tsx | Converts source labels to MessageDescriptors resolved with t() at render. |
| packages/admin/src/components/SectionEditor.tsx | Localizes keywords placeholder. |
| packages/admin/src/components/SetupWizard.tsx | Localizes setup flow error fallbacks and divider text; inlines helpers to capture t. |
| packages/admin/src/components/SignupPage.tsx | Localizes verification-email error fallback. |
| packages/admin/src/components/TaxonomyManager.tsx | Localizes example placeholders in taxonomy dialogs. |
| packages/admin/src/components/TaxonomySidebar.tsx | Localizes module-level taxonomy API fallbacks + inline UI strings. |
| packages/admin/src/components/WelcomeModal.tsx | Passes translated fallback message into module-level dismiss helper. |
| packages/admin/src/components/WordPressImport.tsx | Localizes mutation error fallbacks and step labels. |
| packages/admin/src/components/editor/BlockMenu.tsx | Localizes block menu actions and drag handle aria-label. |
| packages/admin/src/components/editor/DragHandleWrapper.tsx | Localizes block-actions aria-label. |
| .changeset/public-women-behave.md | Adds changeset entry for the admin patch release. |
Comments suppressed due to low confidence (2)
packages/admin/src/components/SandboxedPluginWidget.tsx:50
sendInteraction'suseCallbackclosure readst, but the dependency array only includespluginId. This can capture a stale translation function when the locale changes (and will typically trip the hooks exhaustive-deps lint). Includetin the dependency list (or derive the translated strings outside the callback) so error messages stay in sync with the active locale.
setError(t`Failed to load widget`);
}
},
[pluginId],
);
packages/admin/src/components/SandboxedPluginPage.tsx:58
sendInteractionusestinside theuseCallback, buttis missing from the dependency array. If the active locale changes, this callback can keep using the oldtand produce untranslated/stale strings. Addtto the deps (or avoid closing over it) to keep error messages consistent.
setError(err instanceof Error ? err.message : t`Failed to communicate with plugin`);
}
},
[pluginId],
);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What does this PR do?
Stacked on top of #937. When #937 merges, GitHub will rebase this onto `main` automatically. Set base to `fix/admin-i18n-leaks-v2`.
Wraps the remaining ~80 user-facing English strings in the admin UI (the long tail after #937's top-10 cleanup). After this PR, all currently-known i18n leaks in the admin are fixed.
Files changed (41 total)
Auth flows:
Settings/marketplace:
Plugin sandbox:
Editors / content management:
Module-level lib (`lib/api/*.ts`):
40 `throwResponseError(...)` and `parseApiResponse(...)` fallback strings across 16 files now use `i18n._(msg``)` (the standard Lingui pattern for module-level code that can't call `useLingui()`):
`api-tokens.ts`, `bylines.ts`, `client.ts`, `comments.ts`, `content.ts`, `import.ts`, `marketplace.ts`, `media.ts`, `menus.ts`, `plugins.ts`, `redirects.ts`, `schema.ts`, `sections.ts`, `taxonomies.ts`, `users.ts`, `widgets.ts`.
Test fix:
Approach
Sub-agents (Haiku-based `simple-tasks`) handled most files in parallel — well-specified, mechanical work. The audit was thorough enough that each file's fix was a clear list of lines to wrap.
Closes #
Type of change
Checklist
AI-generated code disclosure
Screenshots / test output
No visual change in default English locale. Run with `EMDASH_PSEUDO_LOCALE=1` to verify the strings now flow through translation.
Follow-up
Stack: `main` → #937 → this PR → (next: raw HTML to Kumo) → (next: aria-labels) → (next: RTL safety) → (next: semantic tokens) → (last: ESLint enforcement)