[wp-trac] [WordPress Trac] #52438: Theme translations in WP_LANG_DIR are loaded twice, no (logical) way to override from a (child) theme.

WordPress Trac noreply at wordpress.org
Sat Nov 30 19:25:50 UTC 2024


#52438: Theme translations in WP_LANG_DIR are loaded twice, no (logical) way to
override from a (child) theme.
---------------------------------------+-------------------------
 Reporter:  captain.crash              |       Owner:  (none)
     Type:  defect (bug)               |      Status:  closed
 Priority:  normal                     |   Milestone:
Component:  I18N                       |     Version:  5.6
 Severity:  minor                      |  Resolution:  worksforme
 Keywords:  needs-patch needs-testing  |     Focuses:
---------------------------------------+-------------------------

Comment (by swissspidy):

 > I can not just load my divergent parent theme translations anyhow?

 I literally shared the code to do this.

 > The correct way would be - because my parent theme translation overrides
 would wipe out all parent theme translations - to make sure I load these
 as well, really?

 The reason is that otherwise your file would be loaded afterwards, and
 then would not ''override'' the translation. Files that are loaded later
 are only used to "fill in the blanks".

 > why is it not looking up and loading translations in this order (only MO
 files for brevity):

 Because that's not how the i18n system or the child theme functionality
 were designed.

 ----

 This has now diverged quite a bit from the original bug report.

 If you want to suggest an enhancement for easier translation overriding
 (which would basically be the opposite of the existing "fill in the
 blanks" order, that is now best done in its own enhancement ticket.

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


More information about the wp-trac mailing list