[wp-trac] [WordPress Trac] #11526: JavaScript l10n inconsistency

WordPress Trac wp-trac at lists.automattic.com
Sun Dec 20 09:46:22 UTC 2009


#11526: JavaScript l10n inconsistency
----------------------------+-----------------------------------------------
 Reporter:  SergeyBiryukov  |       Owner:  nbachiyski
     Type:  defect (bug)    |      Status:  new       
 Priority:  normal          |   Milestone:  Unassigned
Component:  i18n            |     Version:  2.9       
 Severity:  normal          |    Keywords:            
----------------------------+-----------------------------------------------
 After activating some plugins the standard messages displayed in the admin
 area using JavaScript (for example, the confirmation message when deleting
 categories or tags) become not localized.

 Among these plugins are the latest versions of Popularity Contest and Cimy
 User Extra Fields. It turns out they use {{{wp_enqueue_script()}}} and
 {{{wp_register_script()}}} functions not hooked to {{{init}}} action as
 [http://codex.wordpress.org/Function_Reference/wp_enqueue_script
 recommended by Codex], but instead right in the plugin body.

 The following code is currently used in Russian version to restore
 localization in this case:
 {{{
 function restore_scripts_l10n() {
         global $wp_scripts;

         if ( is_a($wp_scripts, 'WP_Scripts') ) {
                 wp_default_scripts($wp_scripts);
         }
 }
 add_action('init', 'restore_scripts_l10n');
 }}}
 However I think the more centralized solution is needed.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11526>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list