Skip to content

Commit 2aa9722

Browse files
committed
Don't translate error strings
1 parent dc50d61 commit 2aa9722

File tree

2 files changed

+14
-20
lines changed

2 files changed

+14
-20
lines changed

wp-includes/sqlite/class-wp-sqlite-db.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,10 @@ public function print_error( $str = '' ) {
133133
wp_load_translations_early();
134134

135135
$caller = $this->get_caller();
136-
$caller = $caller ? $caller : __( '(unknown)', 'sqlite-database-integration' );
136+
$caller = $caller ? $caller : '(unknown)';
137137

138138
$error_str = sprintf(
139-
/* translators: 1: Database error message, 2: SQL query, 3: Caller. */
140-
__( 'WordPress database error %1$s for query %2$s made by %3$s', 'sqlite-database-integration' ),
139+
'WordPress database error %1$s for query %2$s made by %3$s',
141140
$str,
142141
$this->last_query,
143142
$caller
@@ -162,8 +161,7 @@ public function print_error( $str = '' ) {
162161
$query = htmlspecialchars( $this->last_query, ENT_QUOTES );
163162

164163
printf(
165-
/* translators: 1: Database error message, 2: SQL query. */
166-
'<div id="error"><p class="wpdberror">' . __( 'WordPress database error: [%1$s] %2$s', 'sqlite-database-integration' ) . '</p></div>',
164+
'<div id="error"><p class="wpdberror">WordPress database error: [%1$s] %2$s</p></div>',
167165
$str,
168166
'<code>' . $query . '</code>'
169167
);

wp-includes/sqlite/class-wp-sqlite-pdo-engine.php

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,9 @@ function __construct() {
244244
if ( $status > 0 ) {
245245
$message = sprintf(
246246
'<p>%s</p><p>%s</p><p>%s</p>',
247-
__( 'Database initialization error!', 'sqlite-database-integration' ),
248-
/* translators: %d: error code */
249-
sprintf( __( 'Code: %d', 'sqlite-database-integration' ), $status ),
250-
/* translators: %s: error message */
251-
sprintf( __( 'Error Message: %s', 'sqlite-database-integration' ), $err_message )
247+
'Database initialization error!',
248+
"Code: $status",
249+
"Error Message: $err_message"
252250
);
253251
$this->set_error( __LINE__, __FILE__, $message );
254252

@@ -328,19 +326,19 @@ private function prepare_directory() {
328326
if ( ! is_dir( FQDBDIR ) ) {
329327
if ( ! @mkdir( FQDBDIR, 0704, true ) ) {
330328
umask( $u );
331-
wp_die( esc_html__( 'Unable to create the required directory! Please check your server settings.', 'sqlite-database-integration' ), 'Error!' );
329+
wp_die( 'Unable to create the required directory! Please check your server settings.', 'Error!' );
332330
}
333331
}
334332
if ( ! is_writable( FQDBDIR ) ) {
335333
umask( $u );
336-
$message = __( 'Unable to create a file in the directory! Please check your server settings.', 'sqlite-database-integration' );
334+
$message = 'Unable to create a file in the directory! Please check your server settings.';
337335
wp_die( $message, 'Error!' );
338336
}
339337
if ( ! is_file( FQDBDIR . '.htaccess' ) ) {
340338
$fh = fopen( FQDBDIR . '.htaccess', 'w' );
341339
if ( ! $fh ) {
342340
umask( $u );
343-
esc_html_e( 'Unable to create a file in the directory! Please check your server settings.', 'sqlite-database-integration' );
341+
echo 'Unable to create a file in the directory! Please check your server settings.';
344342

345343
return false;
346344
}
@@ -351,7 +349,7 @@ private function prepare_directory() {
351349
$fh = fopen( FQDBDIR . 'index.php', 'w' );
352350
if ( ! $fh ) {
353351
umask( $u );
354-
esc_html_e( 'Unable to create a file in the directory! Please check your server settings.', 'sqlite-database-integration' );
352+
echo 'Unable to create a file in the directory! Please check your server settings.';
355353

356354
return false;
357355
}
@@ -397,8 +395,7 @@ public function query( $statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, ...$fet
397395
$res = $this->determine_query_type( $statement );
398396
if ( ! $res && defined( 'PDO_DEBUG' ) && PDO_DEBUG ) {
399397
$bailout_string = sprintf(
400-
/* translators: %s: SQL statement */
401-
'<h1>' . __( 'Unknown query type', 'sqlite-database-integration' ) . '</h1><p>' . __( 'Sorry, we cannot determine the type of query that is requested (%s).', 'sqlite-database-integration' ) . '</p>',
398+
'<h1>Unknown query type</h1><p>Sorry, we cannot determine the type of query that is requested (%s).</p>',
402399
$statement
403400
);
404401
$this->set_error( __LINE__, __FUNCTION__, $bailout_string );
@@ -604,7 +601,7 @@ public function get_error_message() {
604601

605602
$output = '<div style="clear:both">&nbsp;</div>';
606603
$output .= '<div class="queries" style="clear:both;margin_bottom:2px;border:red dotted thin;">';
607-
$output .= '<p>' . __( 'Queries made or created this session were:', 'sqlite-database-integration' ) . '</p>';
604+
$output .= '<p>Queries made or created this session were:</p>';
608605
$output .= '<ol>';
609606
foreach ( $this->queries as $q ) {
610607
$output .= '<li>' . esc_html( $q ) . '</li>';
@@ -614,8 +611,7 @@ public function get_error_message() {
614611
foreach ( $this->error_messages as $num => $m ) {
615612
$output .= '<div style="clear:both;margin_bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;">';
616613
$output .= sprintf(
617-
/* translators: %1$d: line number, %2$s: function name, %3$s: error message */
618-
__( 'Error occurred at line %1$d in Function %2$s. Error message was: %3$s.', 'sqlite-database-integration' ),
614+
'Error occurred at line %1$d in Function %2$s. Error message was: %3$s.',
619615
(int) $this->errors[ $num ]['line'],
620616
'<code>' . esc_html( $this->errors[ $num ]['function'] ) . '</code>',
621617
$m
@@ -1463,7 +1459,7 @@ private function convert_result_check_or_analyze() {
14631459
'Table' => '',
14641460
'Op' => $is_check ? 'check' : 'analyze',
14651461
'Msg_type' => 'status',
1466-
'Msg_text' => $is_check ? __( 'OK', 'sqlite-database-integration' ) : __( 'Table is already up to date', 'sqlite-database-integration' ),
1462+
'Msg_text' => $is_check ? 'OK' : 'Table is already up to date',
14671463
)
14681464
);
14691465
$this->results = $_results;

0 commit comments

Comments
 (0)