Make WordPress Core


Ignore:
Timestamp:
01/15/2024 06:55:59 PM (14 months ago)
Author:
swissspidy
Message:

Upgrade/Install: Fix JavaScript localization on install page.

Blocks registration causes scripts to be initialized and localized very early, before the current locale has been properly set on the installation page.

This changes determine_locale() so that the locale chosen during installation is recognized and loaded earlier, ensuring proper script localization.

Props sabernhardt, NekoJonez, jornp, costdev.
Fixes #58696

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/l10n.php

    r57233 r57286  
    151151    ) {
    152152        $determined_locale = get_user_locale();
     153    } elseif (
     154        ( ! empty( $_REQUEST['language'] ) || isset( $GLOBALS['wp_local_package'] ) )
     155        && wp_installing()
     156    ) {
     157        if ( ! empty( $_REQUEST['language'] ) ) {
     158            $determined_locale = sanitize_locale_name( $_REQUEST['language'] );
     159        } else {
     160            $determined_locale = $GLOBALS['wp_local_package'];
     161        }
    153162    }
    154163
Note: See TracChangeset for help on using the changeset viewer.