[wp-trac] [WordPress Trac] #65015: Connectors: Several strings are not translated
WordPress Trac
noreply at wordpress.org
Mon Apr 27 18:29:35 UTC 2026
#65015: Connectors: Several strings are not translated
-------------------------------------------------+-------------------------
Reporter: 369work | Owner:
| westonruter
Type: defect (bug) | Status: closed
Priority: high | Milestone: 7.0
Component: I18N | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests connectors | Focuses:
commit dev-feedback needs-dev-note |
-------------------------------------------------+-------------------------
Changes (by westonruter):
* status: reviewing => closed
* resolution: => fixed
Comment:
In [changeset:"62278" 62278]:
{{{
#!CommitTicketReference repository="" revision="62278"
I18N: Add translation support for script modules.
Add automatic translation loading for script modules (ES modules), so
strings using `__()` and friends from `@wordpress/i18n` can be translated
at runtime. This brings classic script i18n parity to script modules
registered via `wp_register_script_module()`, which previously had no way
to load translation data, leaving strings untranslated on screens like
Connectors and Fonts that are built as script modules.
At the `admin_print_footer_scripts` and `wp_footer` actions, every
enqueued script module and its dependencies are walked, the translation
chunk is loaded for each, and an inline `<script>` calls
`wp.i18n.setLocaleData()` so translations are available before deferred
modules execute. Note there is currently a runtime dependency on the `wp-
i18n` classic script, which is printed just-in-time if not already
enqueued. This coupling is to be removed in a future release.
Public API:
* `WP_Script_Modules::set_translations()` stores the text domain (and
optional path) per registered module to override the text domain and path.
A global `wp_set_script_module_translations()` function is added as a
wrapper around `wp_script_modules()->set_translations()`.
* `WP_Script_Modules::get_registered()` obtains a registered module's
data. See #60597.
* `WP_Script_Modules::print_script_module_translations()` emits inline
`wp.i18n.setLocaleData()` calls after classic scripts load but before
modules execute.
* `load_script_module_textdomain()` loads the translation data for a given
script module ID and text domain.
* The existing `load_script_textdomain_relative_path` filter gains a third
`$is_module` parameter so callers can distinguish classic-script and
script-module lookups when resolving translation paths.
PHPStan types are also added in `WP_Script_Modules`. See #64238.
Developed in https://github.com/WordPress/wordpress-develop/pull/11543
Props manzoorwanijk, westonruter, jsnajdr, jonsurrell, mukesh27,
peterwilsoncc, 369work, desrosj, sabernhardt, nilambar, jorgefilipecosta,
malayladu.
See #64238, #60597.
Fixes #65015.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/65015#comment:40>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list