From d64e4beb67a1c53c728274defb6c66a8ed86ae7e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 23 Aug 2016 23:48:28 +0000 Subject: [PATCH] I18N: Add translator comments for strings in `wp-includes/functions.php`. Props ramiy. Fixes #37802. Built from https://develop.svn.wordpress.org/trunk@38344 git-svn-id: http://core.svn.wordpress.org/trunk@38285 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 54 ++++++++++++++++++++++++++++++++------- wp-includes/version.php | 2 +- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 96312798fc..c388dafa85 100644 --- a/wp-includes/functions.php +++ b/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' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index a0031c5180..f5fe9fd3c4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38343'; +$wp_version = '4.7-alpha-38344'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.