Make WordPress Core


Ignore:
Timestamp:
01/26/2012 08:34:27 PM (13 years ago)
Author:
nacin
Message:

Introduce wp_load_translations_early(), which can be used before the locale is properly loaded in order to translate early error strings. Internationalize setup-config.php -- translators no longer have a reason to modify this file. fixes #18180.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/setup-config.php

    r19701 r19760  
    4242/**#@-*/
    4343
    44 require_once(ABSPATH . WPINC . '/load.php');
    45 require_once(ABSPATH . WPINC . '/version.php');
     44require(ABSPATH . WPINC . '/load.php');
     45require(ABSPATH . WPINC . '/version.php');
     46
     47// Also loads functions.php, plugin.php, l10n.php, pomo/mo.php (all required by setup-config.php)
     48wp_load_translations_early();
     49
    4650wp_check_php_mysql_versions();
    4751
    4852require_once(ABSPATH . WPINC . '/compat.php');
    49 require_once(ABSPATH . WPINC . '/functions.php');
    5053require_once(ABSPATH . WPINC . '/class-wp-error.php');
    5154
    52 if (!file_exists(ABSPATH . 'wp-config-sample.php'))
    53     wp_die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.');
     55if ( ! file_exists( ABSPATH . 'wp-config-sample.php' ) )
     56    wp_die( __( 'Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.' ) );
    5457
    5558$config_file = file(ABSPATH . 'wp-config-sample.php');
    5659
    5760// Check if wp-config.php has been created
    58 if (file_exists(ABSPATH . 'wp-config.php'))
    59     wp_die("<p>The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
     61if ( file_exists( ABSPATH . 'wp-config.php' ) )
     62    wp_die( '<p>' . sprintf( __( "The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='%s'>installing now</a>." ), 'install.php' ) . '</p>' );
    6063
    6164// Check if wp-config.php exists above the root directory but is not part of another install
    62 if (file_exists(ABSPATH . '../wp-config.php') && ! file_exists(ABSPATH . '../wp-settings.php'))
    63     wp_die("<p>The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
    64 
    65 if (isset($_GET['step']))
    66     $step = $_GET['step'];
    67 else
    68     $step = 0;
     65if ( file_exists(ABSPATH . '../wp-config.php' ) && ! file_exists( ABSPATH . '../wp-settings.php' ) )
     66    wp_die( '<p>' . sprintf( __( "The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>."), 'install.php' ) . '</p>' );
     67
     68$step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0;
    6969
    7070/**
     
    8383<head>
    8484<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    85 <title>WordPress &rsaquo; Setup Configuration File</title>
     85<title><?php _e( 'WordPress &rsaquo; Setup Configuration File' ); ?></title>
    8686<link rel="stylesheet" href="css/install.css" type="text/css" />
    8787
     
    9797?>
    9898
    99 <p>Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.</p>
     99<p><?php _e( 'Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.' ) ?></p>
    100100<ol>
    101     <li>Database name</li>
    102     <li>Database username</li>
    103     <li>Database password</li>
    104     <li>Database host</li>
    105     <li>Table prefix (if you want to run more than one WordPress in a single database) </li>
     101    <li><?php _e( 'Database name' ); ?></li>
     102    <li><?php _e( 'Database username' ); ?></li>
     103    <li><?php _e( 'Database password' ); ?></li>
     104    <li><?php _e( 'Database host' ); ?></li>
     105    <li><?php _e( 'Table prefix (if you want to run more than one WordPress in a single database)' ); ?></li>
    106106</ol>
    107 <p><strong>If for any reason this automatic file creation doesn't work, don't worry. All this does is fill in the database information to a configuration file. You may also simply open <code>wp-config-sample.php</code> in a text editor, fill in your information, and save it as <code>wp-config.php</code>. </strong></p>
    108 <p>In all likelihood, these items were supplied to you by your Web Host. If you do not have this information, then you will need to contact them before you can continue. If you&#8217;re all ready&hellip;</p>
    109 
    110 <p class="step"><a href="setup-config.php?step=1<?php if ( isset( $_GET['noapi'] ) ) echo '&amp;noapi'; ?>" class="button">Let&#8217;s go!</a></p>
     107<p><strong><?php _e( "If for any reason this automatic file creation doesn't work, don't worry. All this does is fill in the database information to a configuration file. You may also simply open <code>wp-config-sample.php</code> in a text editor, fill in your information, and save it as <code>wp-config.php</code>. </strong></p>
     108<p>In all likelihood, these items were supplied to you by your Web Host. If you do not have this information, then you will need to contact them before you can continue. If you&#8217;re all ready&hellip;" ); ?></p>
     109
     110<p class="step"><a href="setup-config.php?step=1<?php if ( isset( $_GET['noapi'] ) ) echo '&amp;noapi'; ?>" class="button"><?php _e( 'Let&#8217;s go!' ); ?></a></p>
    111111<?php
    112112    break;
     
    116116    ?>
    117117<form method="post" action="setup-config.php?step=2">
    118     <p>Below you should enter your database connection details. If you're not sure about these, contact your host. </p>
     118    <p><?php _e( "Below you should enter your database connection details. If you're not sure about these, contact your host." ); ?></p>
    119119    <table class="form-table">
    120120        <tr>
    121             <th scope="row"><label for="dbname">Database Name</label></th>
     121            <th scope="row"><label for="dbname"><?php _e( 'Database Name' ); ?></label></th>
    122122            <td><input name="dbname" id="dbname" type="text" size="25" value="wordpress" /></td>
    123             <td>The name of the database you want to run WP in. </td>
    124         </tr>
    125         <tr>
    126             <th scope="row"><label for="uname">User Name</label></th>
    127             <td><input name="uname" id="uname" type="text" size="25" value="username" /></td>
    128             <td>Your MySQL username</td>
    129         </tr>
    130         <tr>
    131             <th scope="row"><label for="pwd">Password</label></th>
    132             <td><input name="pwd" id="pwd" type="text" size="25" value="password" /></td>
    133             <td>...and your MySQL password.</td>
    134         </tr>
    135         <tr>
    136             <th scope="row"><label for="dbhost">Database Host</label></th>
     123            <td><?php _e( 'The name of the database you want to run WP in.' ); ?></td>
     124        </tr>
     125        <tr>
     126            <th scope="row"><label for="uname"><?php _e( 'User Name' ); ?></label></th>
     127            <td><input name="uname" id="uname" type="text" size="25" value="<?php echo htmlspecialchars( _x( 'username', 'example username' ), ENT_QUOTES ); ?>" /></td>
     128            <td><?php _e( 'Your MySQL username' ); ?></td>
     129        </tr>
     130        <tr>
     131            <th scope="row"><label for="pwd"><?php _e( 'Password' ); ?></label></th>
     132            <td><input name="pwd" id="pwd" type="text" size="25" value="<?php echo htmlspecialchars( _x( 'password', 'example password' ), ENT_QUOTES ); ?>" /></td>
     133            <td><?php _e( '&hellip;and your MySQL password.' ); ?></td>
     134        </tr>
     135        <tr>
     136            <th scope="row"><label for="dbhost"><?php _e( 'Database Host' ); ?></label></th>
    137137            <td><input name="dbhost" id="dbhost" type="text" size="25" value="localhost" /></td>
    138             <td>You should be able to get this info from your web host, if <code>localhost</code> does not work.</td>
    139         </tr>
    140         <tr>
    141             <th scope="row"><label for="prefix">Table Prefix</label></th>
     138            <td><?php _e( 'You should be able to get this info from your web host, if <code>localhost</code> does not work.' ); ?></td>
     139        </tr>
     140        <tr>
     141            <th scope="row"><label for="prefix"><?php _e( 'Table Prefix' ); ?></label></th>
    142142            <td><input name="prefix" id="prefix" type="text" value="wp_" size="25" /></td>
    143             <td>If you want to run multiple WordPress installations in a single database, change this.</td>
     143            <td><?php _e( 'If you want to run multiple WordPress installations in a single database, change this.' ); ?></td>
    144144        </tr>
    145145    </table>
    146     <?php if ( isset( $_GET['noapi'] ) ) { ?><input name="noapi" type="hidden" value="true" /><?php } ?>
    147     <p class="step"><input name="submit" type="submit" value="Submit" class="button" /></p>
     146    <?php if ( isset( $_GET['noapi'] ) ) { ?><input name="noapi" type="hidden" value="1" /><?php } ?>
     147    <p class="step"><input name="submit" type="submit" value="<?php echo htmlspecialchars( __( 'Submit' ), ENT_QUOTES ); ?>" class="button" /></p>
    148148</form>
    149149<?php
     
    161161    // Validate $prefix: it can only contain letters, numbers and underscores
    162162    if ( preg_match( '|[^a-z0-9_]|i', $prefix ) )
    163         wp_die( /*WP_I18N_BAD_PREFIX*/'<strong>ERROR</strong>: "Table Prefix" can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/ );
     163        wp_die( __( '<strong>ERROR</strong>: "Table Prefix" can only contain numbers, letters, and underscores.' ) );
    164164
    165165    // Test the db connection.
     
    176176    require_wp_db();
    177177    if ( ! empty( $wpdb->error ) ) {
    178         $back = '<p class="step"><a href="setup-config.php?step=1" onclick="javascript:history.go(-1);return false;" class="button">Try Again</a></p>';
     178        $back = '<p class="step"><a href="setup-config.php?step=1" onclick="javascript:history.go(-1);return false;" class="button">' . __( 'Try Again' ) . '</a></p>';
    179179        wp_die( $wpdb->error->get_error_message() . $back );
    180180    }
     
    182182    // Fetch or generate keys and salts.
    183183    $no_api = isset( $_POST['noapi'] );
    184     require_once( ABSPATH . WPINC . '/plugin.php' );
    185     require_once( ABSPATH . WPINC . '/l10n.php' );
    186     require_once( ABSPATH . WPINC . '/pomo/translations.php' );
    187184    if ( ! $no_api ) {
    188185        require_once( ABSPATH . WPINC . '/class-http.php' );
     
    249246        display_header();
    250247?>
    251 <p>Sorry, but I can't write the <code>wp-config.php</code> file.</p>
    252 <p>You can create the <code>wp-config.php</code> manually and paste the following text into it.</p>
     248<p><?php _e( "Sorry, but I can't write the <code>wp-config.php</code> file." ); ?></p>
     249<p><?php _e( 'You can create the <code>wp-config.php</code> manually and paste the following text into it.' ); ?></p>
    253250<textarea cols="98" rows="15" class="code"><?php
    254251        foreach( $config_file as $line ) {
     
    256253        }
    257254?></textarea>
    258 <p>After you've done that, click "Run the install."</p>
    259 <p class="step"><a href="install.php" class="button">Run the install</a></p>
     255<p><?php _e( 'After you\'ve done that, click "Run the install."' ); ?></p>
     256<p class="step"><a href="install.php" class="button"><?php _e( 'Run the install' ); ?></a></p>
    260257<?php
    261258    else :
     
    268265        display_header();
    269266?>
    270 <p>All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to&hellip;</p>
    271 
    272 <p class="step"><a href="install.php" class="button">Run the install</a></p>
     267<p><?php _e( "All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to&hellip;" ); ?></p>
     268
     269<p class="step"><a href="install.php" class="button"><?php _e( 'Run the install' ); ?></a></p>
    273270<?php
    274271    endif;
Note: See TracChangeset for help on using the changeset viewer.