[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:26:45 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):

 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.

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


More information about the wp-trac mailing list