Make WordPress Core

Opened 8 months ago

Closed 8 months ago

Last modified 7 months ago

#62157 closed defect (bug) (duplicate)

load_script_translations does not search in plugins translation path

Reported by: hupe13's profile hupe13 Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.7
Component: I18N Keywords:
Focuses: Cc:

Description

Bug Report

Description

Describe the bug.

Environment

  • WordPress: 6.7-beta1
  • PHP: 8.3.8-nmm1
  • Server: Apache
  • Database: mysqli (Server: 10.6.18-MariaDB-0ubuntu0.22.04.1-log / Client: mysqlnd 8.3.8-nmm1)
  • Browser: Firefox 131.0 (macOS)
  • Theme: Child of Generatepress
  • Plugins: ...
    • Extensions for Leaflet Map Testing version
    • Leaflet Map 3.4.1
    • Query Monitor 3.16.4
    • WordPress Beta Tester 3.5.6


Steps to Reproduce

  1. Open a webpage with an elevation profile in german. (Example WP 6.6.2: https://leafext.de/elevation/track/)
  2. 🐞 Bug occurs.

Expected Results

  1. ✅ What should happen.

Strings from Javascript should be translated.

Actual Results

  1. ❌ What actually happened.

Strings from Javascript are not translated.

Query Monitor in 6.6.2 reports, that the strings type "jed" are loaded from
wp-content/languages/plugins/extensions-leaflet-map-de_DE-11e2d9a1caad4ea1804a55167ba26f01.json

Query Monitor in 6.7. reports, that the strings type "jed" in path
wp-content/languages/themes/extensions-leaflet-map-de_DE-11e2d9a1caad4ea1804a55167ba26f01.json
are searched for but not found.

The search path should include "wp-content/languages/plugins/".

Change History (4)

#1 @swissspidy
8 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version set to trunk

Thanks for your report,

This sounds like a regression from #62016 which itself was supposed to fix another regression.

Closing this in favor of #62016

#2 @swissspidy
7 months ago

FWIW, while I closed this as a duplicate of #62016 I can actually not reproduce this issue in 6.7 Beta 2.

#3 @hupe13
7 months ago

What does changed in WordPress 6.7?

It works in WordPress 6.6.2 without problems, it loads the JavaScript translations from wp-content/languages/plugins/ directory.

I checked your documentation, all seems okay in my plugin.

#4 @swissspidy
7 months ago

See #62016 for what changed in 6.7 and what is currently being worked on.

There's a PR at https://github.com/WordPress/wordpress-develop/pull/7562 that should address the last remaining issue.

Please test that PR and provide feedback on #62016, not here.

Note: See TracTickets for help on using tickets.