#62016 closed defect (bug) (fixed)
The .json files with theme translations are loaded only if they are present in the plugins path
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | 6.6 |
Component: | I18N | Keywords: | has-patch has-unit-tests needs-testing |
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.
Attachments (4)
Change History (27)
#1
@
8 months 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
This ticket was mentioned in PR #7423 on WordPress/wordpress-develop by @swissspidy.
7 months 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
#4
@
7 months ago
- Keywords has-unit-tests added; needs-unit-tests removed
@itapress Does the proposed patch fix the issue for you?
@swissspidy commented on PR #7423:
7 months ago
#8
Committed in https://core.trac.wordpress.org/changeset/59126
#11
@
7 months ago
- Keywords needs-patch added; has-patch needs-testing has-unit-tests commit removed
7 months ago
#13
@swissspidy Could you have a look at whether this is a viable alternative approach?
Replace the changes in this commit with only the following line:
Line 1210 $languages_path = WP_LANG_DIR . '/' . $relative[0];
At least this fixes a regression reported 2 weeks ago: https://core.trac.wordpress.org/ticket/62155
@swissspidy commented on PR #7423:
7 months ago
#14
No, this just reintroduces the original bug.
This ticket was mentioned in PR #7562 on WordPress/wordpress-develop by @swissspidy.
7 months ago
#15
- Keywords has-patch has-unit-tests added; needs-patch removed
Ensure correct languages path when using a custom WP_PLUGIN_DIR
/ WP_PLUGIN_URL
configuration, a custom theme root, and/or using Multisite with subdirectories.
Trac ticket: https://core.trac.wordpress.org/ticket/62016
@swissspidy commented on PR #7423:
7 months ago
#16
@them-es #7562 should address this, please test
7 months ago
#18
@swissspidy Yes that seems to fix the reported Multisite regression. Thank you for the quick turnaround 👍
#19
@
6 months ago
Reproduction Report
Description
The issue can be reproduced in the latest stable WordPress version (6.6.2).
Environment
- WordPress: 6.6.2
- PHP: 8.1.8
- Server: Apache/2.4.53 (Debian)
- Database: mysqli (Server: 5.7.43 / Client: mysqlnd 8.1.8)
- Browser: Firefox 131.0
- OS: macOS
- Theme: Twenty Twenty Four child theme
- MU Plugins: None activated
- Plugins:
- Test Reports 1.1.0
Actual Results
- ✅ Text is not translated (See "Translated?" should be "Traduit!")
Additional Notes
- Tested with a child theme of Twenty Twenty Four loading js file that should alerts a translated text on Multisite (main site + sub site)
Supplemental Artifacts
#20
@
6 months ago
Test Report
Description
The issue is fixed with https://github.com/WordPress/wordpress-develop/pull/7562
Environment
- WordPress: 6.5-beta2-57671-src
- PHP: 8.1.8
- Server: Apache/2.4.53 (Debian)
- Database: mysqli (Server: 5.7.43 / Client: mysqlnd 8.1.8)
- Browser: Firefox 131.0
- OS: macOS
- Theme: Twenty Twenty Four child theme
- MU Plugins: None activated
- Plugins:
- Test Reports 1.1.0
Actual Results
- ✅ The text is translated
Additional Notes
- Tested with a child theme of Twenty Twenty Four loading js file that should alert a translated text on Multisite (main site + sub site)
Supplemental Artifacts
https://core.trac.wordpress.org/attachment/ticket/62016/ticket-62016-patched-main-site.png
https://core.trac.wordpress.org/attachment/ticket/62016/ticket-62016-patched-sub-site.png
@swissspidy commented on PR #7562:
6 months ago
#22
Committed in https://core.trac.wordpress.org/changeset/59264
Thanks for your report! I will look into it.