[wp-trac] [WordPress Trac] #45103: Automatically load JavaScript language packs when scripts are enqueued if these exist.
WordPress Trac
noreply at wordpress.org
Wed Oct 17 12:34:39 UTC 2018
#45103: Automatically load JavaScript language packs when scripts are enqueued if
these exist.
-------------------------+------------------------------
Reporter: herregroen | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: I18N | Version: trunk
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
-------------------------+------------------------------
Comment (by nerrad):
There is a bit of code I worked on here:
https://github.com/WordPress/gutenberg/pull/6051 with regards to the php
side of things. Obviously the source of the strings will be different
from that pull, but I think something similar would work well in core.
The main file/class taking care of detecting and queuing up which strings
to register on `wp.i18n.setLocaleData` (via `wp_add_inline_script` which
in turn is registered to the js files the strings belong to so when they
are enqueued the strings are registered):
https://github.com/WordPress/gutenberg/blob/8bc06fcc97da396894d145e60dd3e0f6f9cc4c3a/lib
/class-gb-scripts.php
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45103#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list