From d73923eb4dc355d7453256dd899486f5fc40cb45 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 3 Jul 2014 22:56:14 +0000 Subject: [PATCH] If we already have a value for WPLANG when installing, insert this language at the top of the language selector and pre-select it. See #28577 Built from https://develop.svn.wordpress.org/trunk@28984 git-svn-id: http://core.svn.wordpress.org/trunk@28773 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/install.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/wp-admin/install.php b/wp-admin/install.php index aa44a153d5..a78c7220b7 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -60,6 +60,12 @@ function wp_get_available_translations() { $response = wp_remote_post( $url, $options ); $body = wp_remote_retrieve_body( $response ); if ( $body && $body = json_decode( $body, true ) ) { + $languages = array(); + // Key the language array with the language code + foreach ( $body['languages'] as $language ) { + $languages[$language['language']] = $language; + } + $body['languages'] = $languages; return $body; } return false; @@ -210,11 +216,18 @@ switch($step) { echo ''; echo "\n"; + if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && ( 'en_US' !== WPLANG ) ) { + if ( isset( $body['languages'][WPLANG] ) ) { + $language = $body['languages'][WPLANG]; + echo ''; + echo '\n"; + } + } + foreach ( $body['languages'] as $language ) { echo ''; echo '\n"; } - echo "\n"; echo '

'; echo '';