[wp-trac] [WordPress Trac] #51123: commonL10n removed without backwards compatibility
WordPress Trac
noreply at wordpress.org
Mon Aug 24 20:01:34 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 kbjohnson90):
A backwards compatibility layer for removed localized variables could be
added to map the configuration to the translated values in JavaScript, as
opposed to PHP.
In this case, the re-usable configuration was replaced with a single use,
inline translation.
Instead, the configuration value could be updated to use `__()` while
maintaining re-usability.
{{{#!js
var commonL10n = {
dismiss: __( 'Dismiss this notice.' ),
...
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51123#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list