[wp-trac] [WordPress Trac] #11832: merge_with() inconsistency in load_textdomain()

WordPress Trac wp-trac at lists.automattic.com
Sat Jan 9 01:11:13 UTC 2010


#11832: merge_with() inconsistency in load_textdomain()
----------------------------+-----------------------------------------------
 Reporter:  SergeyBiryukov  |       Owner:  nbachiyski
     Type:  defect (bug)    |      Status:  new       
 Priority:  normal          |   Milestone:  Unassigned
Component:  i18n            |     Version:  2.9       
 Severity:  normal          |    Keywords:            
----------------------------+-----------------------------------------------
 This code is used in {{{wp-includes/pomo/translations.php}}}:
 {{{
 function merge_with(&$other) {
         $this->entries = array_merge($this->entries, $other->entries);
 }
 }}}
 It creates problems with numeric keys. For example, {{{_e('2')}}} outputs
 4 on a localized version, regardless of the value in a .mo file.
 Perhaps something like this should be used:
 {{{
 function merge_with(&$other) {
         foreach ( $other->entries as $key => $value )
                 $this->entries[$key] = $value;
 }
 }}}

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


More information about the wp-trac mailing list