Skip to content

i18n: Add translator context to the "Copy error" button label - #85967

Merged
simison merged 2 commits into
WordPress:trunkfrom
ariel-maidana:fix/copy-error-translator-context
Nov 9, 2026
Merged

simison merged 2 commits into
WordPress:trunkfrom
ariel-maidana:fix/copy-error-translator-context

Conversation

@ariel-maidana

@ariel-maidana ariel-maidana commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What?

Adds translator context to the "Copy error" button label, so it becomes _x( 'Copy error', 'button label' ). The label appears in five places:

  • packages/editor: error boundary (post/page editor crash notice)
  • packages/edit-widgets: error boundary
  • packages/customize-widgets: error boundary
  • packages/boot: error boundary
  • packages/notices: inline notices (status === 'error')

Why?

Without context, "Copy error" can be read as a noun phrase ("a copy error", i.e. copying failed) instead of an action ("copy the error"). Several locales on translate.wordpress.org translated it as "copy failed". The crash notice then reads as if copying already failed, so users may not use the button to share the error.

Current translations, checked on translate.wordpress.org on 2026-10-29:

Locale Gutenberg (dev) WordPress (dev)
es_ES Error al copiar ❌ Copiar error ✅
es_CO Error al copiar ❌ Error al copiar ❌
es_CL Error al copiar ❌ Error al copiar ❌
gl_ES Error ao copiar ❌ Error ao copiar ❌
ro_RO Eroare la copiere ❌ Eroare la copiere ❌
es_MX, pt_BR, pt_PT, it_IT, fr_FR, ca ✅ (verb) ✅ (verb)

In es_ES Gutenberg, "Copiar error" was the current translation from April 2025 until 2026-09-04, when "Error al copiar" became current again. Two translators read the string in opposite ways, which suggests the wording itself is ambiguous.

How?

Replaces __() with _x() at each call site and adds _x to the @wordpress/i18n imports. The English UI text is unchanged.

The context matches other action buttons, such as _x( 'Import', 'button label' ), _x( 'Try again', 'button label' ) and _x( 'Convert to link', 'button label' ).

Trade-off: adding context creates a new original in GlotPress, so locales that already translate it correctly need to re-approve it. GlotPress translation memory will offer the existing translations as suggestions.

Testing Instructions

  1. Run npm run test:unit -- packages/editor/src/components/error-boundary packages/edit-widgets/src/components/error-boundary packages/customize-widgets/src/components/error-boundary. All tests pass.
  2. Build, then check the POT/JSON extraction: Copy error should carry msgctxt "button label".
  3. Trigger an editor crash (for example, throw inside a block's edit). The notice still shows "Copy contents" and "Copy error", and the button still copies the error.

Screenshots

imagen

Use of AI Tools

I used Claude Code (Claude Opus 5.5) to find the call sites, check the translations on translate.wordpress.org across locales, write the change, run the build and unit tests, and draft this description.

@github-actions github-actions Bot added [Package] Editor /packages/editor [Package] Notices /packages/notices [Package] Edit Widgets /packages/edit-widgets [Package] Boot /packages/boot labels Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ariel-maidana <arielmaidana@git.wordpress.org>
Co-authored-by: simison <simison@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

@ariel-maidana

Copy link
Copy Markdown
Contributor Author

Could a maintainer please add the [Type] Bug label? This adds translator context so "Copy error" isn't translated as "copy failed" (seen in es_ES, es_CO, es_CL, gl_ES, ro_RO; details in the description). cc @swissspidy for the i18n side.

The es_ES translators asked for context on this string in April 2025 and had to rely on a screenshot to understand it.

@swissspidy swissspidy added the [Type] Bug An existing feature does not function as intended label Oct 29, 2026
@swissspidy
swissspidy requested a review from Mamaduka October 29, 2026 23:02
@Mamaduka

Copy link
Copy Markdown
Member

Thanks, @ariel-maidana!

Can we just use 'button label for context? Seems like a general solution for similar action buttons.

@simison

simison commented Nov 5, 2026

Copy link
Copy Markdown
Member

We look to be using "button label" elsewhere already for this kind of control: _x( 'Import', 'button label' ), _x( 'Try again', 'button label' ), _x( 'Convert to link', 'button label' ), would that communicate "action" clearly enough in this case or we need the longer context? Both work for me but just would like @ariel-maidana to confirm.

@simison simison left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall good, let's just get confirmation on exact phrase #85967 (comment)

(And thank you!)

ariel-maidana and others added 2 commits November 9, 2026 08:05
"Copy error" reads as either an action or a noun phrase, and several
locales translated it as "copy failed" (es_ES, es_CO, es_CL, gl_ES,
ro_RO). Use _x() so translators know it is a button that copies the
error message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Matches the context used for other action buttons, such as
_x( 'Import', 'button label' ) and _x( 'Try again', 'button label' ).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ariel-maidana
ariel-maidana force-pushed the fix/copy-error-translator-context branch from 2cbf0e8 to 3c4853f Compare November 9, 2026 11:22
@ariel-maidana

Copy link
Copy Markdown
Contributor Author

Thanks @Mamaduka and @simison!
button label makes it clear this is an action, which is what translators were missing, and it matches the other buttons. I switched to it and rebased onto trunk.

@simison
simison enabled auto-merge (squash) November 9, 2026 11:30
@Mamaduka Mamaduka added the Backport to WP 7.2 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Nov 9, 2026
@Mamaduka

Mamaduka commented Nov 9, 2026

Copy link
Copy Markdown
Member

Added backport label, since some of these are new strings.

@simison
simison merged commit 5275317 into WordPress:trunk Nov 9, 2026
87 checks passed
@github-actions github-actions Bot added this to the Gutenberg 24.5 milestone Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

There was a conflict while trying to cherry-pick the commit to the wp/7.2 branch. Please resolve the conflict manually and create a PR to the wp/7.2 branch.

PRs to wp/7.2 are similar to PRs to trunk, but you should base your PR on the wp/7.2 branch instead of trunk.

# Checkout the wp/7.2 branch instead of trunk.
git checkout wp/7.2

# Create a new branch for your PR.
git checkout -b my-branch

# Cherry-pick the commit.
git cherry-pick 5275317f8115adac72ecf4bcf9a19348e22c621c

# Check which files have conflicts.
git status

# Resolve the conflict...
# Add the resolved files to the staging area.
git status
git add .
git cherry-pick --continue

# Push the branch to the repository
git push origin my-branch

# Create a PR and set the base to the wp/7.2 branch.
# See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request.

@ariel-maidana
ariel-maidana deleted the fix/copy-error-translator-context branch November 9, 2026 20:52
@Mamaduka Mamaduka added Backported to WP Core Pull request that has been successfully merged into WP Core and removed Backport to WP 7.2 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Nov 10, 2026
Mamaduka added a commit that referenced this pull request Nov 10, 2026
"Copy error" reads as either an action or a noun phrase, and several
locales translated it as "copy failed" (es_ES, es_CO, es_CL, gl_ES,
ro_RO). Use _x() so translators know it is a button that copies the
error message.

---------

Co-authored-by: ariel-maidana <arielmaidana@git.wordpress.org>
Co-authored-by: simison <simison@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
wporg-sync pushed a commit to WordPress/wordpress-develop that referenced this pull request Nov 10, 2026
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch).

A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90

- [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269)
- Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293)
- Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294)
- Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295)
- Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306)
- [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303)
- Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308)
- Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311)
- DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369)
- Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329)
- [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379)
- Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424)
- Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359)
- Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416)
- DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426)
- Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367)
- [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450)
- Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423)
- Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491)
- URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477)
- Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395)
- Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463)
- Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809)
- Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549)
- Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968)
- i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967)
- Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263)
- UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501)
- Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578)
- Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327)
- Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511)
- iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461)

Props mamaduka, wildworks.
See #66340.

git-svn-id: https://develop.svn.wordpress.org/trunk@65379 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 10, 2026
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch).

A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90

- [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269)
- Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293)
- Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294)
- Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295)
- Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306)
- [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303)
- Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308)
- Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311)
- DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369)
- Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329)
- [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379)
- Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424)
- Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359)
- Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416)
- DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426)
- Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367)
- [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450)
- Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423)
- Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491)
- URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477)
- Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395)
- Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463)
- Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809)
- Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549)
- Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968)
- i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967)
- Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263)
- UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501)
- Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578)
- Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327)
- Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511)
- iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461)

Props mamaduka, wildworks.
See #66340.
Built from https://develop.svn.wordpress.org/trunk@65379


git-svn-id: http://core.svn.wordpress.org/trunk@64518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
arshidkv12 pushed a commit to arshidkv12/wordpress-develop that referenced this pull request Nov 21, 2026
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch).

A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90

- [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269)
- Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293)
- Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294)
- Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295)
- Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306)
- [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303)
- Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308)
- Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311)
- DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369)
- Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329)
- [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379)
- Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424)
- Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359)
- Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416)
- DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426)
- Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367)
- [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450)
- Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423)
- Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491)
- URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477)
- Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395)
- Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463)
- Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809)
- Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549)
- Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968)
- i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967)
- Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263)
- UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501)
- Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578)
- Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327)
- Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511)
- iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461)

Props mamaduka, wildworks.
See #66340.

git-svn-id: https://develop.svn.wordpress.org/trunk@65379 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core [Package] Boot /packages/boot [Package] Edit Widgets /packages/edit-widgets [Package] Editor /packages/editor [Package] Notices /packages/notices [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants