[wp-trac] [WordPress Trac] #21547: Enable 'delocalization' of scripts

WordPress Trac wp-trac at lists.automattic.com
Sun Aug 12 20:19:52 UTC 2012


#21547: Enable 'delocalization' of scripts
-------------------------+------------------------------
 Reporter:  gkb6891      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------------------

Comment (by azaozz):

 This ticket is basically for the ability to "merge" the already set
 script_data with newly added values. Indeed this was possible to do with
 the proposed `add_script_data()` in #11520 however it didn't make it.

 Localizing a script (as done in WordPress) means setting a simple JS
 object as `string_name : translated_value`, then the main script uses the
 translated strings as needed. Agree it doesn't make sense for this to be
 overwritten. Additionally `html_entity_decode()` needs to be run on the
 translations.

 Adding arbitrary "script_data" was supposed to be the underlying API
 method for localizing a script but with more possibilities like
 merging/overwriting already added data, i.e. exactly what you would use in
 this case.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21547#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list