Make WordPress Core


Ignore:
Timestamp:
06/23/2008 03:40:43 PM (17 years ago)
Author:
ryan
Message:

Mark string that cannot be gettexted. Props nbachiyski. fixes #7074

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/wp-db.php

    r8164 r8168  
    318318        $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true);
    319319        if (!$this->dbh) {
    320             $this->bail("
     320            $this->bail(sprintf(/*WP_I18N_DB_CONN_ERROR*/"
    321321<h1>Error establishing a database connection</h1>
    322 <p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>$dbhost</code>. This could mean your host's database server is down.</p>
     322<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>%s</code>. This could mean your host's database server is down.</p>
    323323<ul>
    324324    <li>Are you sure you have the correct username and password?</li>
     
    327327</ul>
    328328<p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>
    329 ");
     329"/*/WP_I18N_DB_CONN_ERROR*/, $dbhost));
    330330            return;
    331331        }
     
    374374
    375375        if ( preg_match('|[^a-z0-9_]|i', $prefix) )
    376             return new WP_Error('invalid_db_prefix', 'Invalid database prefix'); // No gettext here
     376            return new WP_Error('invalid_db_prefix', /*WP_I18N_DB_BAD_PREFIX*/'Invalid database prefix'/*/WP_I18N_DB_BAD_PREFIX*/);
    377377
    378378        $old_prefix = $this->prefix;
     
    405405        if (!@mysql_select_db($db, $this->dbh)) {
    406406            $this->ready = false;
    407             $this->bail("
     407            $this->bail(sprintf(/*WP_I18N_DB_SELECT_DB*/'
    408408<h1>Can&#8217;t select database</h1>
    409 <p>We were able to connect to the database server (which means your username and password is okay) but not able to select the <code>$db</code> database.</p>
     409<p>We were able to connect to the database server (which means your username and password is okay) but not able to select the <code>%1$s</code> database.</p>
    410410<ul>
    411411<li>Are you sure it exists?</li>
    412 <li>Does the user <code>".DB_USER."</code> have permission to use the <code>$db</code> database?</li>
     412<li>Does the user <code>%2$s</code> have permission to use the <code>%1$s</code> database?</li>
    413413<li>On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. Could that be the problem?</li>
    414414</ul>
    415 <p>If you don't know how to setup a database you should <strong>contact your host</strong>. If all else fails you may find help at the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>");
     415<p>If you don\'t know how to setup a database you should <strong>contact your host</strong>. If all else fails you may find help at the <a href="http://wordpress.org/support/">WordPress Support Forums</a>.</p>'/*/WP_I18N_DB_SELECT_DB*/, $db, DB_USER));
    416416            return;
    417417        }
     
    488488            return false;
    489489
    490         $error_str = "WordPress database error $str for query $this->last_query";
    491490        if ( $caller = $this->get_caller() )
    492             $error_str .= " made by $caller";
     491            $error_str = sprintf(/*WP_I18N_DB_QUERY_ERROR_FULL*/'WordPress database error %1$s for query %2$s made by %3$s'/*/WP_I18N_DB_QUERY_ERROR_FULL*/, $str, $this->last_query, $caller);
     492        else
     493            $error_str = sprintf(/*WP_I18N_DB_QUERY_ERROR*/'WordPress database error %1$s for query %2$s'/*/WP_I18N_DB_QUERY_ERROR*/, $str, $this->last_query);
    493494
    494495        $log_error = true;
     
    746747            return $this->last_result[$y] ? array_values(get_object_vars($this->last_result[$y])) : null;
    747748        } else {
    748             $this->print_error(" \$db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N");
     749            $this->print_error(/*WP_I18N_DB_GETROW_ERROR*/" \$db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N"/*/WP_I18N_DB_GETROW_ERROR*/);
    749750        }
    750751    }
Note: See TracChangeset for help on using the changeset viewer.