From 725a04d815ee7b137fb066bd90e0d553c5cab6cd Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 19 Nov 2016 02:39:33 +0000 Subject: [PATCH] I18N: Add translator comments for strings in `_deprecated_*()` functions. See #38862. Built from https://develop.svn.wordpress.org/trunk@39315 git-svn-id: http://core.svn.wordpress.org/trunk@39255 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 38 ++++++++++++++++++++++++++------------ wp-includes/version.php | 2 +- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 32fa55c9df..b585d05c23 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -3778,15 +3778,19 @@ function _deprecated_function( $function, $version, $replacement = null ) { */ if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) { if ( function_exists( '__' ) ) { - if ( ! is_null( $replacement ) ) + if ( ! is_null( $replacement ) ) { + /* translators: 1: PHP function name, 2: version number, 3: alternative function name */ trigger_error( sprintf( __('%1$s is deprecated since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) ); - else + } else { + /* translators: 1: PHP function name, 2: version number */ trigger_error( sprintf( __('%1$s is deprecated since version %2$s with no alternative available.'), $function, $version ) ); + } } else { - if ( ! is_null( $replacement ) ) + if ( ! is_null( $replacement ) ) { trigger_error( sprintf( '%1$s is deprecated since version %2$s! Use %3$s instead.', $function, $version, $replacement ) ); - else + } else { trigger_error( sprintf( '%1$s is deprecated since version %2$s with no alternative available.', $function, $version ) ); + } } } } @@ -3902,15 +3906,19 @@ function _deprecated_file( $file, $version, $replacement = null, $message = '' ) if ( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) { $message = empty( $message ) ? '' : ' ' . $message; if ( function_exists( '__' ) ) { - if ( ! is_null( $replacement ) ) + if ( ! is_null( $replacement ) ) { + /* translators: 1: PHP file name, 2: version number, 3: alternative file name */ trigger_error( sprintf( __('%1$s is deprecated since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) . $message ); - else + } else { + /* translators: 1: PHP file name, 2: version number */ trigger_error( sprintf( __('%1$s is deprecated since version %2$s with no alternative available.'), $file, $version ) . $message ); + } } else { - if ( ! is_null( $replacement ) ) + if ( ! is_null( $replacement ) ) { trigger_error( sprintf( '%1$s is deprecated since version %2$s! Use %3$s instead.', $file, $version, $replacement ) . $message ); - else + } else { trigger_error( sprintf( '%1$s is deprecated since version %2$s with no alternative available.', $file, $version ) . $message ); + } } } } @@ -3962,15 +3970,19 @@ function _deprecated_argument( $function, $version, $message = null ) { */ if ( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) { if ( function_exists( '__' ) ) { - if ( ! is_null( $message ) ) + if ( ! is_null( $message ) ) { + /* translators: 1: PHP function name, 2: version number, 3: optional message regarding the change */ trigger_error( sprintf( __('%1$s was called with an argument that is deprecated since version %2$s! %3$s'), $function, $version, $message ) ); - else + } else { + /* translators: 1: PHP function name, 2: version number */ trigger_error( sprintf( __('%1$s was called with an argument that is deprecated since version %2$s with no alternative available.'), $function, $version ) ); + } } else { - if ( ! is_null( $message ) ) + if ( ! is_null( $message ) ) { trigger_error( sprintf( '%1$s was called with an argument that is deprecated since version %2$s! %3$s', $function, $version, $message ) ); - else + } else { trigger_error( sprintf( '%1$s was called with an argument that is deprecated since version %2$s with no alternative available.', $function, $version ) ); + } } } } @@ -4018,8 +4030,10 @@ function _deprecated_hook( $hook, $version, $replacement = null, $message = null if ( WP_DEBUG && apply_filters( 'deprecated_hook_trigger_error', true ) ) { $message = empty( $message ) ? '' : ' ' . $message; if ( ! is_null( $replacement ) ) { + /* translators: 1: PHP hook name, 2: version number, 3: alternative hook name */ trigger_error( sprintf( __( '%1$s is deprecated since version %2$s! Use %3$s instead.' ), $hook, $version, $replacement ) . $message ); } else { + /* translators: 1: PHP hook name, 2: version number */ trigger_error( sprintf( __( '%1$s is deprecated since version %2$s with no alternative available.' ), $hook, $version ) . $message ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index a7093354c8..22aa5d9720 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta4-39314'; +$wp_version = '4.7-beta4-39315'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.