Make WordPress Core

#62557 closed defect (bug) (worksforme)

Language still messed up

Reported by: Stefan M. Owned by:
Priority: normal Milestone:
Component: I18N Version: 6.7.1
Severity: normal Keywords:
Cc: Focuses:

Description

I have a shop mioselection.com. Since the 6.7 Update, there was half english half german language. Bevore there was everything german.

I updated to 6.7.1 today, and translation still messed up.

Still a lot of following error messages:

[24-Nov-2024 10:11:08 UTC] PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>woocommerce-paypal-payments</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="​https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /home/fifuhoti/public_html/mioselection.com/wp-includes/functions.php on line 6114

It seams, all plugins and also the theme is triggering the same error.

<?php
add_action('init', function () {
        if (function_exists('load_plugin_textdomain')) {
                load_plugin_textdomain('WUKCAL', PLUGINDIR.'/'.dirname(plugin_basename(__FILE__)).'/languages', dirname(plugin_basename( __FILE__ )).'/languages');
        }
});

How is that wrong?

Change History (1)

#1 @swissspidy
23 months ago

  • Component General → I18N
  • Milestone Awaiting Review
  • Resolution → worksforme
  • Severity critical → normal
  • Status new → closed

Still a lot of following error messages:

That means those plugins are still doing and wrong and the devs need to follow ​https://make.wordpress.org/core/2024/10/21/i18n-improvements-6-7/ to make their code more robust.

Most plugins and themes have already released updates by now, so make sure your site is up-to-date.

How is that wrong?

That code alone is not wrong.

If you encounter the warning for your own code, that means something else is triggering translation loading even before init.

The above blog post has some guidance on how to debug the issue, for example using Query Monitor or a snippet like this to find the root cause:

add_action(
	'doing_it_wrong_run',
	static function ( $function_name ) {
		if ( '_load_textdomain_just_in_time' === $function_name ) {
			debug_print_backtrace();
		}
	}
);
Note: See TracTickets for help on using tickets.