WordPress.org

Make WordPress Core

Changeset 19070


Ignore:
Timestamp:
10/27/2011 06:31:45 PM (7 years ago)
Author:
ryan
Message:

Make repair.php fully translatable. Props ocean90. fixes #18770

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/maint/repair.php

    r18460 r19070  
    2222    echo '<p>'.__('To allow use of this page to automatically repair database problems, please add the following line to your wp-config.php file.  Once this line is added to your config, reload this page.')."</p><code>define('WP_ALLOW_REPAIR', true);</code>";
    2323} elseif ( isset($_GET['repair']) ) {
    24     $problems = array();
    2524    check_admin_referer('repair_db');
    2625
     
    3130
    3231    $okay = true;
     32    $problems = array();
    3333
    3434    $tables = $wpdb->tables();
     35
    3536    // Sitecategories may not exist if global terms are disabled.
    3637    if ( is_multisite() && ! $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->sitecategories'" ) )
    3738        unset( $tables['sitecategories'] );
     39
    3840    $tables = array_merge( $tables, (array) apply_filters( 'tables_to_repair', array() ) ); // Return tables with table prefixes.
     41
    3942    // Loop over the tables, checking and repairing as needed.
    4043    foreach ( $tables as $table ) {
    4144        $check = $wpdb->get_row("CHECK TABLE $table");
     45
     46        echo '<p>';
    4247        if ( 'OK' == $check->Msg_text ) {
    43             echo "<p>The $table table is okay.";
     48            /* translators: %s: table name */
     49            printf( __( 'The %s table is okay.' ), $table );
    4450        } else {
    45             echo "<p>The $table table is not okay. It is reporting the following error: <code>$check->Msg_text</code>.  WordPress will attempt to repair this table&hellip;";
     51            /* translators: 1: table name, 2: error message, */
     52            printf( __( 'The %1$s table is not okay. It is reporting the following error: %2$s.  WordPress will attempt to repair this table&hellip;' ) , $table, "<code>$check->Msg_text</code>" );
     53
    4654            $repair = $wpdb->get_row("REPAIR TABLE $table");
     55
     56            echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
    4757            if ( 'OK' == $check->Msg_text ) {
    48                 echo "<br />&nbsp;&nbsp;&nbsp;&nbsp;Successfully repaired the $table table.";
     58                /* translators: %s: table name */
     59                printf( __( 'Successfully repaired the %s table.' ), $table );
    4960            } else {
    50                 echo "<br />&nbsp;&nbsp;&nbsp;&nbsp;Failed to repair the $table table. Error: $check->Msg_text<br />";
    51                 $problems["$table"] = $check->Msg_text;
     61                /* translators: 1: table name, 2: error message, */
     62                echo sprintf( __( 'Failed to repair the  %1$s table. Error: %2$s' ), $table, "<code>$check->Msg_text</code>" ) . '<br />';
     63                $problems[$table] = $check->Msg_text;
    5264                $okay = false;
    5365            }
    5466        }
     67
    5568        if ( $okay && $optimize ) {
    5669            $check = $wpdb->get_row("ANALYZE TABLE $table");
     70
     71            echo '<br />&nbsp;&nbsp;&nbsp;&nbsp';
    5772            if ( 'Table is already up to date' == $check->Msg_text )  {
    58                 echo "<br />&nbsp;&nbsp;&nbsp;&nbsp;The $table table is already optimized.";
     73                /* translators: %s: table name */
     74                printf( __( 'The %s table is already optimized.' ), $table );
    5975            } else {
    6076                $check = $wpdb->get_row("OPTIMIZE TABLE $table");
    61                 if ( 'OK' == $check->Msg_text || 'Table is already up to date' == $check->Msg_text )
    62                     echo "<br />&nbsp;&nbsp;&nbsp;&nbsp;Successfully optimized the $table table.";
    63                 else
    64                     echo "<br />&nbsp;&nbsp;&nbsp;&nbsp;Failed to optimize the $table table. Error: $check->Msg_text";
     77
     78                echo '<br />&nbsp;&nbsp;&nbsp;&nbsp';
     79                if ( 'OK' == $check->Msg_text || 'Table is already up to date' == $check->Msg_text ) {
     80                    /* translators: %s: table name */
     81                    printf( __( 'Successfully optimized the $table table.' ), $table );
     82                } else {
     83                    /* translators: 1: table name, 2: error message, */
     84                    printf( __( 'Failed to optimize the $table table. Error: $check->Msg_text' ), $table,"<code>$check->Msg_text</code>" );
     85                }
    6586            }
    6687        }
Note: See TracChangeset for help on using the changeset viewer.