[wp-trac] [WordPress Trac] #45103: Automatically load JavaScript translations when scripts are enqueued if these exist.

WordPress Trac noreply at wordpress.org
Tue Oct 30 12:40:30 UTC 2018


#45103: Automatically load JavaScript translations when scripts are enqueued if
these exist.
------------------------------------------+-------------------------
 Reporter:  herregroen                    |       Owner:  herregroen
     Type:  enhancement                   |      Status:  reopened
 Priority:  high                          |   Milestone:  5.0
Component:  I18N                          |     Version:  trunk
 Severity:  critical                      |  Resolution:
 Keywords:  needs-unit-tests needs-patch  |     Focuses:  javascript
------------------------------------------+-------------------------

Comment (by herregroen):

 Uploaded a latest patch ( `.8.diff` was moving one of the tests files but
 that seems to not show up in the diff ) with the following additions:
 - Expand unit tests.
 - Make setting translations lazy so they are only loaded when printed.
 This is because otherwise when enqueueing a script with dependencies you
 would have to set translations on all your dependencies as well.
 - Fix path comparison for plugin files.

 @nerrad @swissspidy @ocean90 I'm hoping to commit this tomorrow to ensure
 it's there once meta gets updated to produce the new language packs and
 also to allow me to start setting the appropriate translations for all
 gutenberg scripts for #45161.

 I would love your feedback.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45103#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list