[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 13:33:50 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 nerrad):

 Replying to [comment:30 herregroen]:
 > Replying to [comment:29 nerrad]:
 > > > 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.
 > >
 > > If you're lazy loading when printing, this should make it possible to
 set the translations after ''registering'' the script right?  In which
 case, it'd be nice to have tests verify that as well.
 >
 > `test_wp_set_script_translations_after_register` should cover that
 scenario.

 Oops completely missed that (obviously)!

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


More information about the wp-trac mailing list