Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_load_textdomain_just_in_time for translations / i18n loaded too early #4322

Closed
wintermoor opened this issue Nov 13, 2024 · 1 comment · Fixed by #4325
Closed

_load_textdomain_just_in_time for translations / i18n loaded too early #4322

wintermoor opened this issue Nov 13, 2024 · 1 comment · Fixed by #4325
Assignees
Labels
bug This label could be used to identify issues that are caused by a defect in the product.

Comments

@wintermoor
Copy link

Description

There is a new change in WordPress 6.7 that prevents plugins from loading translations too early, without waiting for more parts of WordPress being loaded. It also changes how load_plugin_textdomain() works, as it delays actual loading until the first __() call is encountered.

Refreshing my site with Neve theme brings up this notice like an error message.

I'd like to see no warnings and that strings are actually translated.

Solution:

This happened to WooCommerce plugin, too. They fixed it with these pull requests:
woocommerce/woocommerce#52055
Unfortunaly, I'm unable to contribute because of lacking coding knowledge. Maybe anybody else can take a look at this issue?

Step-by-step reproduction instructions

  1. Use WordPress 6.7
  2. Set site language to something other than en_US
  3. Ensure all translations are installed
  4. Refresh site

Screenshots, screen recording, code snippet or Help Scout ticket

Notice: Die Funktion _load_textdomain_just_in_time wurde fehlerhaft aufgerufen. Das Laden der Übersetzung für die Domain neve wurde zu früh ausgelöst. Das ist normalerweise ein Hinweis auf Code im Plugin oder Theme, der zu früh läuft. Übersetzungen sollten mit der Aktion init oder später geladen werden. Weitere Informationen: Debugging in WordPress (engl.). (Diese Meldung wurde in Version 6.7.0 hinzugefügt.) in /var/www/vhosts/event.XXXXXX.de/httpdocs/wp-includes/functions.php on line 6114

Environment info

https://pastebin.com/4buASWDz

Is the issue you are reporting a regression

Yes, this is a regression.

@wintermoor wintermoor added the bug This label could be used to identify issues that are caused by a defect in the product. label Nov 13, 2024
@pirate-bot pirate-bot added the regression Issue represents a change in behavior from a previous version that is not intended or desired.. label Nov 13, 2024
@vytisbulkevicius vytisbulkevicius removed the regression Issue represents a change in behavior from a previous version that is not intended or desired.. label Nov 18, 2024
@girishpanchal30 girishpanchal30 linked a pull request Nov 19, 2024 that will close this issue
6 tasks
@wintermoor
Copy link
Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This label could be used to identify issues that are caused by a defect in the product.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants