[wp-trac] [WordPress Trac] #40392: load_textdomain() fails to merge in additional translations

WordPress Trac noreply at wordpress.org
Sun Apr 9 11:21:15 UTC 2017


#40392: load_textdomain() fails to merge in additional translations
-------------------------------+------------------------------
 Reporter:  muranyia           |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  I18N               |     Version:  4.7.3
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by muranyia):

 Replying to [comment:1 ocean90]:
 > Hello @muranyia, thanks for your ticket!
 >
 > This sounds like a duplicate of #37819. Can you confirm that?

 Hi,
 Yes and no. In #37819 the goal seems to be to overwrite loaded
 tramslations, which the documentation never claimed you could do, although
 it's a feature that would certainly make sense. The function reference for
 `load_plugin_textdomain()` says: ''"If you call load_plugin_textdomain
 multiple times for the same domain, the translations will be merged. If
 both sets have the same string, the translation from the original value
 will be taken."''
 This bug simply suggests a fix so that code works as documented, as the
 use of the referential assignment seems to be a typo that serves no
 purpose.
 Any further decision whether overwriting translations shall be possible
 (i.e. what is default direction of merging) can be done separately from
 this issue/fix, and (imho) shall be done in fashion that doesn't break
 existing applications that utilize these functions.

 So, attachment:37819.2.diff:ticket:37819 aims to solve the defunct
 assignment AND to reverse the direction of the merging. I suggest that the
 assignment is fixed a.s.a.p and then the idea of changing the merging
 logic is evaluated more carefully.

 Nevertheless, you are free to consider this a duplicate and I can do my
 comments at #37819.

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


More information about the wp-trac mailing list