Skip to content

Fix(admin): Localize plugin API errors - #1469

Merged
ascorbic merged 2 commits into
emdash-cms:mainfrom
pitscher:fix/localize-plugin-api-errors
Jun 15, 2026
Merged

Fix(admin): Localize plugin API errors#1469
ascorbic merged 2 commits into
emdash-cms:mainfrom
pitscher:fix/localize-plugin-api-errors

Conversation

@pitscher

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR is a follow-up on: #1244

It localizes the plugin API fallback error messages to get them covered by Lingui.

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 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e50dae5

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 review/needs-review No maintainer or bot review yet area/admin size/S labels Jun 14, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/auth-atproto

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

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

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

emdash

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

create-emdash

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

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

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

@emdash-cms/plugin-cli

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

@emdash-cms/plugin-types

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

@emdash-cms/registry-client

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

@emdash-cms/registry-lexicons

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

@emdash-cms/sandbox-workerd

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-field-kit

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: e50dae5

@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 PR is a clean, scoped follow-up that localizes the remaining hard-coded English fallback error messages in packages/admin/src/lib/api/plugins.ts. The approach is sound and consistent with the existing codebase: fetchManifest in the same directory’s client.ts and several marketplace endpoints already use the i18n._(msg\…`)` pattern for runtime translation outside React components.

I checked:

  • Approach & scope: Narrow and correct. Only plugins.ts is touched, matching the stated goal of localizing plugin API errors.
  • Localization pattern: i18n._(msg\…`) with interpolation (pluginId) is valid Lingui macro syntax and matches usage across the admin API layer. The i18nsingleton is loaded and activated inApp.tsx` before any component-driven API calls occur.
  • Logic & regressions: No behavior changes other than string source. No missing awaits, no type issues, no altered control flow.
  • AGENTS.md conventions: Changeset is present, properly formatted, and user-facing (present-tense verb + observable effect). No .po files are modified, following the extraction-on-merge rule. No tests are required for this pure string-localization change.
  • Siblings/cross-cutting: Other API files still contain unlocalized fallback strings, but those are outside this PR’s scope and there is no requirement to bulk-fix them.

No issues found.

@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 15, 2026
@ascorbic
ascorbic merged commit 263392f 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