mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Database: Don't translate the "WordPress database error" message in the error log.
When using multilingual websites, this string could end up with multiple different translations in the error log, making it less actionable. Unlike errors displayed to the user, a general consensus for software is that errors in logs should always be in English. Since MySQL errors are also returned in English, this brings more consistency to the logs. Follow-up to [6391], [8168], [19760]. Props malthert. Fixes #53125. git-svn-id: https://develop.svn.wordpress.org/trunk@53505 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1568,15 +1568,12 @@ class wpdb {
|
||||
return false;
|
||||
}
|
||||
|
||||
wp_load_translations_early();
|
||||
|
||||
$caller = $this->get_caller();
|
||||
if ( $caller ) {
|
||||
/* translators: 1: Database error message, 2: SQL query, 3: Name of the calling function. */
|
||||
$error_str = sprintf( __( 'WordPress database error %1$s for query %2$s made by %3$s' ), $str, $this->last_query, $caller );
|
||||
// Not translated, as this will only appear in the error log.
|
||||
$error_str = sprintf( 'WordPress database error %1$s for query %2$s made by %3$s', $str, $this->last_query, $caller );
|
||||
} else {
|
||||
/* translators: 1: Database error message, 2: SQL query. */
|
||||
$error_str = sprintf( __( 'WordPress database error %1$s for query %2$s' ), $str, $this->last_query );
|
||||
$error_str = sprintf( 'WordPress database error %1$s for query %2$s', $str, $this->last_query );
|
||||
}
|
||||
|
||||
error_log( $error_str );
|
||||
@@ -1586,6 +1583,8 @@ class wpdb {
|
||||
return false;
|
||||
}
|
||||
|
||||
wp_load_translations_early();
|
||||
|
||||
// If there is an error then take note of it.
|
||||
if ( is_multisite() ) {
|
||||
$msg = sprintf(
|
||||
|
||||
Reference in New Issue
Block a user