Make WordPress Core

Ticket #29487: 29487.3.diff

File 29487.3.diff, 3.3 KB (added by nacin, 10 years ago)
  • src/wp-admin/install.php

     
    181181        die( '<h1>' . __( 'Configuration Error' ) . '</h1><p>' . __( 'Your <code>wp-config.php</code> file has an empty database table prefix, which is not supported.' ) . '</p></body></html>' );
    182182}
    183183
    184 $langugage = '';
     184$language = '';
    185185if ( ! empty( $_REQUEST['language'] ) ) {
    186         $langugage = preg_replace( '/[^a-zA-Z_]/', '', $_REQUEST['language'] );
     186        $language = preg_replace( '/[^a-zA-Z_]/', '', $_REQUEST['language'] );
     187} elseif ( isset( $GLOBALS['wp_local_package'] ) ) {
     188        $language = $GLOBALS['wp_local_package'];
    187189}
    188190
    189191switch($step) {
    190192        case 0: // Step 0
    191193
    192                 if ( wp_can_install_language_pack() && empty( $langugage ) && ( $languages = wp_get_available_translations() ) ) {
     194                if ( wp_can_install_language_pack() && empty( $language ) && ( $languages = wp_get_available_translations() ) ) {
    193195                        display_header( 'language-chooser' );
    194196                        echo '<form id="setup" method="post" action="?step=1">';
    195197                        wp_install_language_form( $languages );
     
    200202                // Deliberately fall through if we can't reach the translations API.
    201203
    202204        case 1: // Step 1, direct link or from language chooser.
    203                 if ( ! empty( $langugage ) ) {
    204                         $loaded_language = wp_download_language_pack( $langugage );
     205                if ( ! empty( $language ) ) {
     206                        $loaded_language = wp_download_language_pack( $language );
    205207                        if ( $loaded_language ) {
    206208                                load_default_textdomain( $loaded_language );
    207209                                $GLOBALS['wp_locale'] = new WP_Locale();
     
    211213                display_header();
    212214?>
    213215<h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1>
    214 <p><?php __( 'Welcome to the famous five-minute WordPress installation process! Just fill in the information below and you&#8217;ll be on your way to using the most extendable and powerful personal publishing platform in the world.' ); ?></p>
     216<p><?php _e( 'Welcome to the famous five-minute WordPress installation process! Just fill in the information below and you&#8217;ll be on your way to using the most extendable and powerful personal publishing platform in the world.' ); ?></p>
    215217
    216218<h1><?php _e( 'Information needed' ); ?></h1>
    217219<p><?php _e( 'Please provide the following information. Don&#8217;t worry, you can always change these settings later.' ); ?></p>
     
    220222                display_setup_form();
    221223                break;
    222224        case 2:
    223                 if ( ! empty( $langugage ) && load_default_textdomain( $langugage ) ) {
    224                         $loaded_language = $langugage;
     225                if ( ! empty( $language ) && load_default_textdomain( $language ) ) {
     226                        $loaded_language = $language;
    225227                        $GLOBALS['wp_locale'] = new WP_Locale();
    226228                } else {
    227229                        $loaded_language = 'en_US';
  • src/wp-admin/setup-config.php

     
    9090$language = '';
    9191if ( ! empty( $_REQUEST['language'] ) ) {
    9292        $language = preg_replace( '/[^a-zA-Z_]/', '', $_REQUEST['language'] );
     93} elseif ( isset( $GLOBALS['wp_local_package'] ) ) {
     94        $language = $GLOBALS['wp_local_package'];
    9395}
     96
    9497switch($step) {
    9598        case -1:
    9699                if ( wp_can_install_language_pack() && empty( $language ) && ( $languages = wp_get_available_translations() ) ) {