mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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 git-svn-id: https://develop.svn.wordpress.org/trunk@57286 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -150,6 +150,15 @@ function determine_locale() {
|
||||
( isset( $_GET['_locale'] ) && 'user' === $_GET['_locale'] && wp_is_json_request() )
|
||||
) {
|
||||
$determined_locale = get_user_locale();
|
||||
} elseif (
|
||||
( ! empty( $_REQUEST['language'] ) || isset( $GLOBALS['wp_local_package'] ) )
|
||||
&& wp_installing()
|
||||
) {
|
||||
if ( ! empty( $_REQUEST['language'] ) ) {
|
||||
$determined_locale = sanitize_locale_name( $_REQUEST['language'] );
|
||||
} else {
|
||||
$determined_locale = $GLOBALS['wp_local_package'];
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $determined_locale ) {
|
||||
|
||||
Reference in New Issue
Block a user