[wp-trac] [WordPress Trac] #51123: commonL10n removed without backwards compatibility
WordPress Trac
noreply at wordpress.org
Tue Aug 25 00:26:13 UTC 2020
#51123: commonL10n removed without backwards compatibility
---------------------------+------------------------------
Reporter: kbjohnson90 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Script Loader | Version: 5.5
Severity: normal | Resolution:
Keywords: | Focuses: javascript
---------------------------+------------------------------
Comment (by peterwilsoncc):
Could something along these lines be added to each affected file?
{{{#!js
// First line
window.commonL10n = window.commonL10n || {};
// As needed.
commonL10n.someString = __( 'Some string' );
commonL10n.anotherString = __( 'Another string' );
}}}
A back-compat break would remain for any plugins that have filtered the
strings upon registration in the script loader, but I suspect that is an
edge case.
I am also very slightly concerned such an approach makes the changes in
the earlier commits a little redundant as the `commonL10n` object remains
in memory, it simply results in requiring the `wp-i18n` script as a
dependency for each of the files.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51123#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list