WordPress.org

Make WordPress Core

Ticket #11644: 11644.7.diff

File 11644.7.diff, 12.9 KB (added by nacin, 10 years ago)

First pass on strings in options-network.php

  • wp-admin/options-network.php

     
    3434<form method="post" action="options-network.php">
    3535<?php
    3636function filestats( $err ) {
    37         print '<h2>' . esc_html__('Server Summary') . '</h2>';
    38         print '<p>' . __("If you post a message to the WordPress support forum at <a target='_blank' href='http://wordpress.org/support/'>http://wordpress.org/support/</a> then copy and paste the following information into your message:") . '</p>';
    39 
    40         print "<blockquote style='background: #eee; border: 1px solid #333; padding: 5px;'>";
    41         print "<br /><strong>ERROR: $err</strong><br />";
     37?>
     38        <h2><?php esc_html_e('Server Summary'); ?></h2>
     39        <p><?php _e('If you post a message to the WordPress support forum at <a target="_blank" href="http://wordpress.org/support/">http://wordpress.org/support/</a> then copy and paste the following information into your message:'); ?></p>
     40        <blockquote style="background: #eee; border: 1px solid #333; padding: 5px;">
     41        <br /><strong><?php echo __('ERROR:') . " $err"; ?></strong><br />
     42<?php
    4243        clearstatcache();
    4344        $files = array( "htaccess.dist", ".htaccess" );
    4445       
     46        $indent = '&nbsp;&nbsp;&nbsp;&nbsp;';
    4547        foreach ( (array) $files as $val ) {
    4648                $stats = @stat( $val );
    4749                if( $stats ) {
    48                         print "<h2>$val</h2>";
    49                         print "&nbsp;&nbsp;&nbsp;&nbsp;uid/gid: " . $stats[ 'uid' ] . "/" . $stats[ 'gid' ] . "<br />\n";
    50                         print "&nbsp;&nbsp;&nbsp;&nbsp;size: " . $stats[ 'size' ] . "<br />";
    51                         print "&nbsp;&nbsp;&nbsp;&nbsp;perms: " . substr( sprintf('%o', fileperms( $val ) ), -4 ) . "<br />";
    52                         print "&nbsp;&nbsp;&nbsp;&nbsp;readable: ";
    53                         print is_readable( $val ) == true ? "yes" : "no";
    54                         print "<br />";
    55                         print "&nbsp;&nbsp;&nbsp;&nbsp;writeable: ";
    56                         print is_writeable( $val ) == true ? "yes" : "no";
    57                         print "<br />";
    58                 } elseif( file_exists( $val ) == false ) {
    59                         print "<h2>$val</h2>";
    60                         print "&nbsp;&nbsp;&nbsp;&nbsp;FILE NOT FOUND: $val<br />";
     50?>
     51                        <h2><?php echo esc_html( $val ); ?></h2>
     52                        <?php echo $indent . sprintf( __('uid/gid: %1$s/%2$s'), $stats[ 'uid' ], $stats[ 'gid' ] ); ?><br />
     53                        <?php echo $indent . sprintf( __('size: %s'), $stats['size'] ); ?><br/>
     54                        <?php echo $indent . sprintf( __('perms: %s'), substr( sprintf('%o', fileperms( $val ) ), -4 ) ); ?><br/>
     55                        <?php echo $indent . sprintf( __('readable: %s'), is_readable( $val ) ? __('yes') : __('no') ); ?><br/>
     56                        <?php echo $indent . sprintf( __('writeable: %s'), is_writeable( $val ) ? __('yes') : __('no') ); ?><br/>
     57<?php
     58                } elseif( ! file_exists( $val ) ) {
     59?>
     60                        <h2><?php echo esc_html( $val ); ?></h2>
     61                        <?php echo $indent . sprintf( __('FILE NOT FOUND: %s'), $val ); ?><br/>
     62<?php
    6163                }
    6264        }
    63         print "</blockquote>";
     65        echo "</blockquote>";
    6466}
    6567
    6668function step2_htaccess() {
     
    7375        }
    7476        $htaccess_sample = ABSPATH . 'wp-admin/includes/htaccess.ms';
    7577        if ( !file_exists( $htaccess_sample ) )
    76                 wp_die("Sorry, I need a {$htaccess_sample} to work from. Please re-upload this file to your WordPress installation.");
     78                wp_die( sprintf( __('Sorry, I need a %s to work from. Please re-upload this file to your WordPress installation.'), $htaccess_sample ) );
    7779
    7880        $htaccess_file = file( $htaccess_sample );
    7981        $fp = @fopen( $htaccess_sample, "r" );
     
    8486                fclose( $fp );
    8587                $htaccess_file = str_replace( "BASE", $base, $htaccess );
    8688        } else {
    87                 wp_die("Sorry, I need to be able to read {$htaccess_sample}. Please check the permissions on this file.");
     89                wp_die( sprintf( __('Sorry, I need to be able to read %s. Please check the permissions on this file.'), $htaccess_sample ) );
    8890        }
    8991
    9092        //@todo: check for super-cache in use
    9193?>
    92                         <li><p>Replace the contents of your <code>.htaccess</code> with the following:</p>
     94                        <li><p><?php _e('Replace the contents of your <code>.htaccess</code> with the following:'); ?></p>
    9395                                <textarea name="htaccess" cols="120" rows="20">
    9496<?php echo $htaccess_file; ?>
    9597                                </textarea>
     
    105107       
    106108        <h2><?php esc_html_e('What do I need?'); ?></h2>
    107109        <ul>
    108                 <li>Access to your server to change directory permissions. This can be done through ssh or ftp for example.</li>
    109                 <li>A valid email where your password and administrative emails will be sent.</li>
    110                 <li> Wildcard dns records if you're going to use the virtual host (sub-domain) functionality. Check the <a href='http://trac.mu.wordpress.org/browser/trunk/README.txt'>README</a> for further details.</li>
     110                <li><?php _e( 'Access to your server to change directory permissions. This can be done through ssh or ftp for example.' ); ?></li>
     111                <li><?php _e( 'A valid email where your password and administrative emails will be sent.' ); ?></li>
     112                <li><?php _e( "Wildcard dns records if you're going to use the virtual host (sub-domain) functionality. Check the <a href='http://trac.mu.wordpress.org/browser/trunk/README.txt'>README</a> for further details."); ?></li>
    111113        </ul>
    112114        <?php
    113         $mod_rewrite_msg = "<p>If the <code>mod_rewrite</code> module is disabled ask your administrator to enable that module, or look at the <a href='http://httpd.apache.org/docs/mod/mod_rewrite.html'>Apache documentation</a> or <a href='http://www.google.com/search?q=apache+mod_rewrite'>elsewhere</a> for help setting it up.</p>";
     115        $mod_rewrite_msg = "\n<p>" . __( "If the <code>mod_rewrite</code> module is disabled ask your administrator to enable that module, or look at the <a href='http://httpd.apache.org/docs/mod/mod_rewrite.html'>Apache documentation</a> or <a href='http://www.google.com/search?q=apache+mod_rewrite'>elsewhere</a> for help setting it up." ) . '</p>';
    114116       
    115         if( function_exists( "apache_get_modules" ) ) {
     117        if ( function_exists( 'apache_get_modules' ) ) {
    116118                $modules = apache_get_modules();
    117                 if( in_array( "mod_rewrite", $modules ) == false ) {
    118                         echo "<p><strong>Warning!</strong> It looks like mod_rewrite is not installed.</p>" . $mod_rewrite_msg;
    119                 } else {
     119                if ( ! in_array( 'mod_rewrite', $modules ) )
     120                        echo '<p>' . __('<strong>Warning!</strong> It looks like mod_rewrite is not installed.') . '</p>' . $mod_rewrite_msg;
     121                else
    120122                        $rewrite_enabled = true;
    121                 }
    122123        } else {
    123                 ?><p>Please make sure <code>mod_rewrite</code> is installed as it will be activated at the end of this install.</p><?php
    124                 echo $mod_rewrite_msg;
     124                echo '<p>' . __( 'Please make sure <code>mod_rewrite</code> is installed as it will be activated at the end of this install.' ) . '</p>' . $mod_rewrite_msg;
    125125        }
    126126        return $rewrite_enabled;
    127127}
    128128
    129129function printstep1form( $rewrite_enabled = false ) {
    130         $weblog_title = ucfirst( get_option( 'blogname' ) ) . ' Sites';
     130        $weblog_title = sprintf( __('%s Sites'), ucfirst( get_option( 'blogname' ) ) );
    131131        $email = get_option( 'admin_email' );
    132132        $hostname = get_clean_basedomain();
    133133        if( substr( $hostname, 0, 4 ) == 'www.' )
     
    136136        wp_nonce_field( 'install-network-1' );
    137137        ?>
    138138                <input type='hidden' name='action' value='step2' />
    139                 <h2>Site Addresses</h2>
    140                 <p>Please choose whether you would like sites in your WordPress install to use sub-domains or sub-directories. You can not change this later.</p>
     139                <h2><?php esc_html_e( 'Site Addresses' ); ?></h2>
     140                <p><?php _e( 'Please choose whether you would like sites in your WordPress install to use sub-domains or sub-directories. You cannot change this later.' ); ?></p>
    141141                <?php if ( !$rewrite_enabled ) { ?>
    142                 <p><strong>Note</strong> It looks like <code>mod_rewrite</code> is not installed.</p>
     142                <p><?php _e( '<strong>Note</strong> It looks like <code>mod_rewrite</code> is not installed.'); ?></p>
    143143                <?php } ?>
    144144                <p class="blog-address">
    145                         <label><input type='radio' name='vhost' value='yes' <?php if( $rewrite_enabled ) echo 'checked="checked"'; ?> /> Sub-domains (like <code>blog1.example.com</code>)</label><br />
    146                         <label><input type='radio' name='vhost' value='no' <?php if( !$rewrite_enabled ) echo 'checked="checked"'; ?> /> Sub-directories (like <code>example.com/blog1</code>)</label>
     145                        <label><input type='radio' name='vhost' value='yes'<?php if( $rewrite_enabled ) echo ' checked="checked"'; ?> /> <?php _e( 'Sub-domains (like <code>blog1.example.com</code>)' ); ?></label><br />
     146                        <label><input type='radio' name='vhost' value='no'<?php if( !$rewrite_enabled ) echo ' checked="checked"'; ?> /> <?php _e( 'Sub-directories (like <code>example.com/blog1</code>) '); ?></label>
    147147                </p>
    148148
    149                 <h2>Server Address</h2>
     149                <h2><?php esc_html_e( 'Server Address' ); ?></h2>
    150150                <?php if ( isset( $nowww ) ) { ?>
    151                 <h3>We recommend you change your siteurl to <code><?php echo $nowww; ?></code> before enabling the network feature. It will still be possible to visit your site using the "www" prefix with an address like <code><?php echo $hostname; ?></code> but any links will not have the "www" prefix. </h3>
     151                <h3><?php printf( __( 'We recommend you change your siteurl to <code>%1$s</code> before enabling the network feature. It will still be possible to visit your site using the "www" prefix with an address like <code>%2$s</code> but any links will not have the "www" prefix.' ), $nowww, $hostname ); ?></h3>
    152152                <?php } ?>
    153153                <table class="form-table"> 
    154154                        <tr>
    155                                 <th scope='row'>Server Address</th>
     155                                <th scope='row'><?php esc_html_e( 'Server Address' ); ?></th>
    156156                                <td>
    157                                         <p>This will be the Internet address of your site: <strong><em><?php echo $hostname; ?></em></strong>.</p>
    158                                         <input type='hidden' name='basedomain' value='<?php echo $hostname ?>' />
    159                                         <p>Do not use an IP address (like 127.0.0.1) or a single word hostname like <q>localhost</q> as your server address.</p>
     157                                        <p><?php printf( __( 'This will be the Internet address of your site: <strong><em>%s</em></strong>.' ), $hostname ); ?></p>
     158                                        <input type='hidden' name='basedomain' value='<?php echo esc_attr( $hostname ); ?>' />
     159                                        <p><?php _e( 'Do not use an IP address (like 127.0.0.1) or a single word hostname like <q>localhost</q> as your server address.' ); ?></p>
    160160                                </td>
    161161                        </tr>
    162162                </table>
    163163
    164                 <h2>Site Details</h2>
     164                <h2><?php esc_html_e( 'Site Details' ); ?></h2>
    165165                <table class="form-table"> 
    166166                        <tr>
    167                                 <th scope='row'>Site&nbsp;Title</th>
     167                                <th scope='row'><?php esc_html_e( 'Site&nbsp;Title' ); ?></th>
    168168                                <td>
    169                                         <input name='weblog_title' type='text' size='45' value='<?php echo $weblog_title ?>' />
    170                                         <br />What would you like to call your site?
     169                                        <input name='weblog_title' type='text' size='45' value='<?php echo esc_attr( $weblog_title ); ?>' />
     170                                        <br /><?php _e( 'What would you like to call your site?' ); ?>
    171171                                </td>
    172172                        </tr>
    173173                        <tr>
    174                                 <th scope='row'>Email</th>
     174                                <th scope='row'><?php esc_html_e( 'Email' ); ?></th>
    175175                                <td>
    176                                         <input name='email' type='text' size='45' value='<?php echo $email ?>' />
    177                                         <br />Your email address.
     176                                        <input name='email' type='text' size='45' value='<?php echo esc_attr( $email ); ?>' />
     177                                        <br /><?php _e( 'Your email address.' ); ?>
    178178                                </td>
    179179                        </tr>
    180180                </table>
    181                 <p class='submit'><input class="button" name='submit' type='submit' value='Proceed' /></p>
     181                <p class='submit'><input class="button" name='submit' type='submit' value='<?php esc_attr_e( 'Proceed' ); ?>' /></p>
    182182        <?php
    183183}
    184184
    185185function step2() {
    186186?>
    187                 <h2>Enabling WordPress Sites</h2>
    188                 <p>Complete the following steps to enable the features for creating a network of sites. <strong>Note:</strong> We recommend you make a backup copy of your existing <code>wp-config.php</code> and <code>.htaccess</code> files.</p>
     187                <h2><?php esc_html_e( 'Enabling WordPress Sites' ); ?></h2>
     188                <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites. <strong>Note:</strong> We recommend you make a backup copy of your existing <code>wp-config.php</code> and <code>.htaccess</code> files.' ); ?></p>
    189189                <ol>
    190                         <li>Create a <code>blogs.dir</code> directory in your <code>wp-content</code> directory. This directory is used to stored uploaded media for your additional sites and must be writeable by the web server.</li>
     190                        <li><?php _e( 'Create a <code>blogs.dir</code> directory in your <code>wp-content</code> directory. This directory is used to stored uploaded media for your additional sites and must be writeable by the web server.' ); ?></li>
    191191<?php step2_config(); ?>
    192192<?php step2_htaccess(); ?>
    193193                </ol>
     
    202202
    203203        $config_sample = ABSPATH . 'wp-admin/includes/wp-config.ms';
    204204        if ( !file_exists( $config_sample ) )
    205                 wp_die("Sorry, I need a {$config_sample} to work from. Please re-upload this file to your WordPress installation.");
     205                wp_die( sprintf( __( 'Sorry, I need a <code>%s</code> to work from. Please re-upload this file to your WordPress installation.' ), $config_sample ) );
    206206
    207207        $wp_config_file = file( $config_sample );
    208208?>
    209                         <li><p>Replace the contents of your <code>wp-config.php</code> with the following:</p>
     209                        <li><p><?php _e( 'Replace the contents of your <code>wp-config.php</code> with the following:' ); ?></p>
    210210                                <textarea name="wp-config" cols="120" rows="20">
    211211<?php
    212212        foreach ($wp_config_file as $line) {