[wp-trac] [WordPress Trac] #20491: Introduce some JavaScript i18n functions

WordPress Trac noreply at wordpress.org
Sat Oct 8 19:26:05 UTC 2016


#20491: Introduce some JavaScript i18n functions
--------------------------------------+-----------------------------
 Reporter:  johnbillion               |       Owner:  swissspidy
     Type:  enhancement               |      Status:  assigned
 Priority:  normal                    |   Milestone:  Future Release
Component:  I18N                      |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  javascript
--------------------------------------+-----------------------------

Comment (by swissspidy):

 [attachment:20491-applied.2.diff] extends the efforts to most if not all
 parts of the customizer. Not yet addressed are underscore templates.

 It probably makes most sense to pass strings used in them to the template
 instead of printing them directly. Reduces redundancy and makes code more
 clear. Otherwise templates will get huge, see
 `wp_print_admin_notice_templates()` / #38112 as an example.

 > I have a site where I need to implement CSP headers. It's already quite
 some fiddling. Please help getting rid of inline js. See #32067. Thank
 you!

 This patch already reduces plenty of inline JavaScript. While
 [attachment:20491.7.diff] currently uses inline scripts to pass the
 translations, the Ajax route can always be considered later on. See it as
 a first step in the right direction.

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


More information about the wp-trac mailing list