[wp-trac] [WordPress Trac] #10286: load_textdomain: Incorrect PHPDoc and possibly unwanted merging behaviour

WordPress Trac wp-trac at lists.automattic.com
Sat Jun 27 12:48:23 GMT 2009


#10286: load_textdomain: Incorrect PHPDoc and possibly unwanted merging behaviour
--------------------------+-------------------------------------------------
 Reporter:  rovo89        |       Owner:  nbachiyski         
     Type:  defect (bug)  |      Status:  new                
 Priority:  normal        |   Milestone:  2.8.1              
Component:  i18n          |     Version:  2.8                
 Severity:  normal        |    Keywords:  has-patch needs-doc
--------------------------+-------------------------------------------------
 The PHPDoc for load_textdomain in wp-includes/l10n.php says that loading a
 file for an already existing domain will fail. This was correct at the
 time when the comment was written, but the function has been changed after
 that and now merges the translations.

 However, if a string has been translated in both the already loaded and
 the new file, the existing translation will be used. In my opinion, it
 should be the other way round. If I'm satisfied with the translations in
 general, but want to change just a few of the strings, I have to change
 the translation file (which would be necessary again for every new
 version). It would be easier to create a new file with only the changed
 translations. However, the default domain is loaded at the very beginning,
 so I can't simply use {{{ load_textdomain('default', $myfile); }}}

 The attached patch changes this behaviour so that new translations will
 overwrite existing ones. The PHPDoc should then be changed to reflect the
 actual behaviour in case of an existing domain. Maybe the @uses references
 are outdated as well, I'm not sure.

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


More information about the wp-trac mailing list