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
This commit is contained in:
Pascal Birchler 2024-02-24 09:48:13 +00:00
parent c5f64356af
commit f5487209cb
2 changed files with 1 additions and 3 deletions

View File

@ -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.

View File

@ -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' ) ) {