Make WordPress Core

Opened 4 years ago

Last modified 4 years ago

#43222 new defect (bug)

l10n merging and priority

Reported by: hnhn2 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.2
Component: I18N Keywords:
Focuses: Cc:

Description (last modified by ocean90)


I'd like to better understand how the prioritization of .mo files should be working, as the behavior seems backwards.

Having a multi-language site, I'm getting wrong language strings under these circumstances:

  1. I place plugin translations for select languages under wp-content/languages/plugins/plugin-xx_YY.mo
  2. I select a language other than default
  3. WordPress seems to always load the site's default language .mo first
  4. Then when language is switched by a multi-lang plugin, the code in l10n.php merging in the translations seems to prioritize the original entries over the 'new' ones:


At 590: $mo->merge_with( $l10n[$domain] );
will override the newly loaded .mo entries (in selected language)
with the ones loaded before (site's original language).

And so I end up with a site that's mostly translated to the selected language with strings for the 'plugin' in site's original language no matter what I do.

Since merge_with() always overwrites the entries, shouldn't it be used as $orig->merge_with($new) rather than the current $new->merge_with($orig) in l10n.php?


Change History (2)

#1 @ocean90
4 years ago

  • Description modified (diff)

Related/Duplicate: #40392, #37819

#2 @hnhn2
4 years ago

Is there any plan on resolving the issue? #37819 has been known for 18 months now.

Note: See TracTickets for help on using tickets.