Skip to content

I18N: Make plugin activation aria-labels in updates.js translatable - #14067

Closed
maheshbohara wants to merge 1 commit into
WordPress:trunkfrom
maheshbohara:66266-translatable-plugin-activation-aria-labels
Closed

maheshbohara wants to merge 1 commit into
WordPress:trunkfrom
maheshbohara:66266-translatable-plugin-activation-aria-labels

Conversation

@maheshbohara

Copy link
Copy Markdown

Wraps two aria-label strings in wp.updates.activatePluginSuccess() in __() so they can be translated:

  • %s activated successfully.
  • %s is active.

Both already had translators comments but were passed to sprintf() as bare string literals, so they were never extracted and are always output in English. They were introduced in [57545]. No other string in core's JS has this problem.

Note on scope: since [58250] (6.5.4) the Activate buttons in core navigate to the activation URL, so core itself no longer calls wp.updates.activatePlugin(). The untranslated labels are only reachable by plugins or custom code using that public API.

Trac ticket: https://core.trac.wordpress.org/ticket/66266

Testing instructions

  1. Set the site language to a non-English locale, e.g. German.
  2. Go to Plugins > Add Plugin and find the card of an installed, inactive plugin (e.g. search for "Hello Dolly").
  3. In the browser console, run:
    var $b = jQuery( '.plugin-card-hello-dolly .activate-now' );
    $b.removeClass( 'activate-now button-primary' ).addClass( 'activating-message' );
    wp.updates.activatePlugin( { slug: $b.data( 'slug' ), name: $b.data( 'name' ), plugin: $b.data( 'plugin' ) } );
  4. Inspect the button's aria-label.

The strings are not in the language packs yet, so to see a translated label, provide one first, e.g. wp.i18n.setLocaleData( { '%s activated successfully.': [ '%s wurde erfolgreich aktiviert.' ] } ).

Before After
German, translation available Hello Dolly 1.7.2 activated successfully. Hello Dolly 1.7.2 wurde erfolgreich aktiviert.
German, from the plugin details modal Hello Dolly is active. Hello Dolly ist aktiv.
English Hello Dolly 1.7.2 activated successfully. unchanged

wp i18n make-pot on updates.js extracts 84 strings before and 86 after; the only additions are these two, with their translators comments. grunt jshint:core passes for the file.

No unit test is included: this is a string-only change, and tests/qunit/wp-admin/js/updates.js is not currently loaded by tests/qunit/index.html.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus
Used for: Investigating and reproducing the issue, writing the two-line change, running the verification above, and drafting this description. I reviewed the change and take responsibility for it.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

The `%s activated successfully.` and `%s is active.` aria-label strings in `wp.updates.activatePluginSuccess()` had translators comments but were not wrapped in `__()`, so they were never extracted for translation.

Follow-up to [57545].

See #66266.
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props maheshbohara.

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

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

wporg-sync pushed a commit that referenced this pull request Oct 7, 2026
Developed in #14067.

Props maheshbohara.
Fixes #66266.



git-svn-id: https://develop.svn.wordpress.org/trunk@64226 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 64226
GitHub commit: 6788d11

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Oct 7, 2026
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Oct 7, 2026
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.

2 participants