Skip to content

Fix(admin): Localize PluginFieldErrorBoundary - #1455

Merged
ascorbic merged 2 commits into
emdash-cms:mainfrom
pitscher:fix/add-missing-locale-strings-PluginFieldErrorBoundary
Jun 15, 2026
Merged

ascorbic merged 2 commits into
emdash-cms:mainfrom
pitscher:fix/add-missing-locale-strings-PluginFieldErrorBoundary

Conversation

@pitscher

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR is a follow-up on: #1244

It wraps the PluginFieldErrorBoundary heading, fallback message, and retry action with Lingui so they use the active admin locale.
For now, the PluginFieldErrorBoundary is fully covered for translations. Translators can pickup the changes of their messages.po to finish this story.

Closes #

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs — a workflow extracts catalogs on merge to main.
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion: https://github.com/emdash-cms/emdash/discussions/...

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Codex with GPT 5.5

Screenshots / test output

@changeset-bot

changeset-bot Bot commented Jun 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5df0a01

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@emdash-cms/admin Patch
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/sandbox-workerd Patch
@emdash-cms/fixture-perf-site Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch
@emdash-cms/auth Patch
@emdash-cms/blocks Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
create-emdash Patch
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

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

@github-actions github-actions Bot added area/admin size/S review/needs-review No maintainer or bot review yet labels Jun 13, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@1455

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@1455

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@1455

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@1455

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@1455

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@1455

emdash

npm i https://pkg.pr.new/emdash@1455

create-emdash

npm i https://pkg.pr.new/create-emdash@1455

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@1455

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@1455

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@1455

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@1455

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@1455

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@1455

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@1455

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@1455

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@1455

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@1455

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@1455

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@1455

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@1455

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@1455

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@1455

commit: 5df0a01

@emdashbot emdashbot 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.

This is a focused, correct follow-up PR that wraps three hard-coded English strings in PluginFieldErrorBoundary with Lingui <Trans> so they respect the active admin locale.

Approach: Right change, right place. Localizing user-facing UI strings is exactly what AGENTS.md requires, and using <Trans> from @lingui/react/macro is the standard pattern in the admin package. Because this is a class component, <Trans> in JSX is the idiomatic choice (the useLingui hook is unavailable here).

What I checked:

  • The diff is limited to the component and a changeset—no messages.po churn, which follows the convention.
  • The changeset follows AGENTS.md guidance (present-tense verb, describes the observable fix, no internals).
  • Import path matches every other usage of Trans in packages/admin/src.
  • The {error?.message || <Trans>…</Trans>} fallback preserves the original || semantics; empty or missing plugin error messages correctly fall back to the localized text.
  • No directional Tailwind classes are introduced; the component remains RTL-safe.
  • No tests exist for this component, and a pure localization change of this scope doesn't strictly require new ones.

The implementation is clean and introduces no regressions.

@github-actions github-actions Bot added review/approved Approved; no new commits since and removed review/needs-review No maintainer or bot review yet labels Jun 13, 2026
@ascorbic
ascorbic merged commit 52ea731 into emdash-cms:main Jun 15, 2026
44 checks passed
@emdashbot emdashbot Bot mentioned this pull request Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/admin review/approved Approved; no new commits since size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants