[wp-trac] [WordPress Trac] #45425: Add a filter to the translation file location for script localisation
WordPress Trac
noreply at wordpress.org
Tue Nov 27 00:49:12 UTC 2018
#45425: Add a filter to the translation file location for script localisation
--------------------------+--------------------
Reporter: johnbillion | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.0
Component: I18N | Version: 5.0
Severity: normal | Keywords:
Focuses: javascript |
--------------------------+--------------------
In [43825] (#45103), the `load_script_textdomain()` function was
introduced as part of the changes that allow JavaScript files to register
and use translated strings.
This function doesn't pass its return value through a filter, which means
it's not possible to override the paths used for translation files, nor is
it possible to inspect its behaviour for debugging purposes. The latter is
particularly noteworthy because this is brand new functionality that
plugin and theme authors will be attempting to implement, and being able
to debug what translation files are being loaded is valuable.
I propose that this function is altered so it operates a little more
similarly to the existing `load_plugin_textdomain()` and
`load_textdomain()` functions for gettext translation files.
cc @omarreiss @herregroen
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45425>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list