From 5ae7139efa0b9b0ba3816d8bcf950ecc90ba8152 Mon Sep 17 00:00:00 2001
From: Sergey Biryukov
Date: Tue, 23 Aug 2016 23:47:28 +0000
Subject: [PATCH] I18N: Add translator comments for strings in
`wp-includes/functions.php`.
Props ramiy.
Fixes #37802.
git-svn-id: https://develop.svn.wordpress.org/trunk@38344 602fd350-edb4-49c9-b593-d223f7449a82
---
src/wp-includes/functions.php | 54 +++++++++++++++++++++++++++++------
1 file changed, 45 insertions(+), 9 deletions(-)
diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
index 96312798fc..c388dafa85 100644
--- a/src/wp-includes/functions.php
+++ b/src/wp-includes/functions.php
@@ -1411,7 +1411,12 @@ function is_blog_installed() {
wp_load_translations_early();
// Die with a DB error.
- $wpdb->error = sprintf( __( 'One or more database tables are unavailable. The database may need to be repaired.' ), 'maint/repair.php?referrer=is_blog_installed' );
+ $wpdb->error = sprintf(
+ /* translators: %s: database repair URL */
+ __( 'One or more database tables are unavailable. The database may need to be repaired.' ),
+ 'maint/repair.php?referrer=is_blog_installed'
+ );
+
dead_db();
}
@@ -1895,7 +1900,11 @@ function wp_upload_dir( $time = null, $create_dir = true, $refresh_cache = false
$error_path = basename( $uploads['basedir'] ) . $uploads['subdir'];
}
- $uploads['error'] = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), esc_html( $error_path ) );
+ $uploads['error'] = sprintf(
+ /* translators: %s: directory path */
+ __( 'Unable to create directory %s. Is its parent directory writable by the server?' ),
+ esc_html( $error_path )
+ );
}
$tested_paths[ $path ] = $uploads['error'];
@@ -2157,7 +2166,11 @@ function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
else
$error_path = basename( $upload['basedir'] ) . $upload['subdir'];
- $message = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), $error_path );
+ $message = sprintf(
+ /* translators: %s: directory path */
+ __( 'Unable to create directory %s. Is its parent directory writable by the server?' ),
+ $error_path
+ );
return array( 'error' => $message );
}
@@ -2516,13 +2529,27 @@ function get_allowed_mime_types( $user = null ) {
*/
function wp_nonce_ays( $action ) {
if ( 'log-out' == $action ) {
- $html = sprintf( __( 'You are attempting to log out of %s' ), get_bloginfo( 'name' ) ) . '
';
+ $html = sprintf(
+ /* translators: %s: site name */
+ __( 'You are attempting to log out of %s' ),
+ get_bloginfo( 'name' )
+ );
+ $html .= '
';
$redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
- $html .= sprintf( __( "Do you really want to log out?"), wp_logout_url( $redirect_to ) );
+ $html .= sprintf(
+ /* translators: %s: logout URL */
+ __( 'Do you really want to log out?' ),
+ wp_logout_url( $redirect_to )
+ );
} else {
$html = __( 'Are you sure you want to do this?' );
- if ( wp_get_referer() )
- $html .= "
" . __( 'Please try again.' ) . "";
+ if ( wp_get_referer() ) {
+ $html .= '
';
+ $html .= sprintf( '%s',
+ esc_url( remove_query_arg( 'updated', wp_get_referer() ) ),
+ __( 'Please try again.' )
+ );
+ }
}
wp_die( $html, __( 'WordPress Failure Notice' ), 403 );
@@ -3990,14 +4017,23 @@ function _doing_it_wrong( $function, $message, $version ) {
*/
if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
if ( function_exists( '__' ) ) {
- $version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
+ if ( is_null( $version ) ) {
+ $version = '';
+ } else {
+ /* translators: %s: version number */
+ $version = sprintf( __( '(This message was added in version %s.)' ), $version );
+ }
/* translators: %s: Codex URL */
$message .= ' ' . sprintf( __( 'Please see Debugging in WordPress for more information.' ),
__( 'https://codex.wordpress.org/Debugging_in_WordPress' )
);
trigger_error( sprintf( __( '%1$s was called incorrectly. %2$s %3$s' ), $function, $message, $version ) );
} else {
- $version = is_null( $version ) ? '' : sprintf( '(This message was added in version %s.)', $version );
+ if ( is_null( $version ) ) {
+ $version = '';
+ } else {
+ $version = sprintf( '(This message was added in version %s.)', $version );
+ }
$message .= sprintf( ' Please see Debugging in WordPress for more information.',
'https://codex.wordpress.org/Debugging_in_WordPress'
);