Make WordPress Core

Opened 4 weeks ago

Last modified 6 days ago

#62016 reopened defect (bug)

The .json files with theme translations are loaded only if they are present in the plugins path

Reported by: itapress's profile itapress Owned by: swissspidy's profile swissspidy
Milestone: 6.7 Priority: normal
Severity: normal Version: 6.6
Component: I18N Keywords: needs-patch
Focuses: Cc:

Description

Hello.

Following this change: https://github.com/WordPress/WordPress/commit/54a61e9c9b36970fe18b33fe2c35a5823617ffca

Theme translation .json files are loaded only if present in the "wp-content/languages/plugins/" path and not from the “wp-content/languages/themes/” path.

I discovered the problem and tested it with the Dutch translation of the Kadence and Astra themes.

Thanks.

Change History (12)

#1 @swissspidy
4 weeks ago

  • Milestone changed from Awaiting Review to 6.7
  • Owner set to swissspidy
  • Status changed from new to reviewing
  • Version changed from 6.6.1 to 6.6

Thanks for your report! I will look into it.

This ticket was mentioned in PR #7423 on WordPress/wordpress-develop by @swissspidy.


2 weeks ago
#2

  • Keywords has-patch added

The change in https://core.trac.wordpress.org/ticket/60891 / https://core.trac.wordpress.org/changeset/57922 was not tested enough with themes that load script translations. It caused a regression where WP tried to look up script translations for a theme in wp-content/languages/plugins.

Even when using a custom WP_PLUGIN_DIR/WP_PLUGIN_URL configuration, we should always use the correct path for themes and plugins alike.

To-do:

  • [ ] Add unit tests

Trac ticket: https://core.trac.wordpress.org/ticket/62016

#3 @swissspidy
2 weeks ago

  • Keywords needs-unit-tests needs-testing added

#4 @swissspidy
10 days ago

  • Keywords has-unit-tests added; needs-unit-tests removed

@itapress Does the proposed patch fix the issue for you?

#5 @itapress
10 days ago

@swissspidy I tried this fix and everything works fine for me. Thanks!

#6 @swissspidy
8 days ago

  • Keywords commit added

#7 @swissspidy
8 days ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 59126:

I18N: Fix script languages path for themes.

Remove hardcoded path added in [57922] which ignored the fact that themes can also use script translations.
They should not be affected even if plugins are installed outside the typical wp-content/plugins location.

Props itapress, swissspidy.
Fixes #62016.

#9 @swissspidy
6 days ago

#62157 was marked as a duplicate.

#10 @swissspidy
6 days ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#11 @swissspidy
6 days ago

  • Keywords needs-patch added; has-patch needs-testing has-unit-tests commit removed

#12 @swissspidy
6 days ago

#62155 was marked as a duplicate.

Note: See TracTickets for help on using tickets.