From f5487209cb6ca277ff9f4a99862782e87d48df7b Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sat, 24 Feb 2024 09:48:13 +0000 Subject: [PATCH] I18N: Do not set translation controller locale in bootstrap. Removes the `WP_Translation_Controller::set_locale()` call from `wp-settings.php`, which happened before the current user was loaded. That caused translations to be missing when the site locale and user locale were different, as the translation was associated with the wrong locale. Turns out this call was not needed at all, as the locale will be set/updated when calling `load_textdomain()` anyway. Props oglekler. See #59656. Built from https://develop.svn.wordpress.org/trunk@57704 git-svn-id: http://core.svn.wordpress.org/trunk@57205 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-settings.php | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index 45fd5e21ce..9ea45dd1fc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-beta2-57703'; +$wp_version = '6.5-beta2-57704'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-settings.php b/wp-settings.php index a284dcb6e4..ecc2717d19 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -641,8 +641,6 @@ $GLOBALS['wp_locale'] = new WP_Locale(); $GLOBALS['wp_locale_switcher'] = new WP_Locale_Switcher(); $GLOBALS['wp_locale_switcher']->init(); -WP_Translation_Controller::get_instance()->set_locale( $locale ); - // Load the functions for the active theme, for both parent and child theme if applicable. foreach ( wp_get_active_and_valid_themes() as $theme ) { if ( file_exists( $theme . '/functions.php' ) ) {