I18N: Improve translator comments.

* Add missing translator comments.
* Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.

Includes minor code layout fixes.

Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!

Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.

git-svn-id: https://develop.svn.wordpress.org/trunk@45926 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2019-09-01 17:12:43 +00:00
parent 425d6fd925
commit a7513ac8e0
139 changed files with 1906 additions and 542 deletions

View File

@@ -2525,7 +2525,10 @@ function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
$ifp = @fopen( $new_file, 'wb' );
if ( ! $ifp ) {
return array( 'error' => sprintf( __( 'Could not write file %s' ), $new_file ) );
return array(
/* translators: %s: file name */
'error' => sprintf( __( 'Could not write file %s' ), $new_file ),
);
}
fwrite( $ifp, $bits );
@@ -4630,9 +4633,9 @@ function _deprecated_constructor( $class, $version, $parent_class = '' ) {
if ( WP_DEBUG && apply_filters( 'deprecated_constructor_trigger_error', true ) ) {
if ( function_exists( '__' ) ) {
if ( ! empty( $parent_class ) ) {
/* translators: 1: PHP class name, 2: PHP parent class name, 3: version number, 4: __construct() method */
trigger_error(
sprintf(
/* translators: 1: PHP class name, 2: PHP parent class name, 3: version number, 4: __construct() method */
__( 'The called constructor method for %1$s in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.' ),
$class,
$parent_class,
@@ -4641,9 +4644,9 @@ function _deprecated_constructor( $class, $version, $parent_class = '' ) {
)
);
} else {
/* translators: 1: PHP class name, 2: version number, 3: __construct() method */
trigger_error(
sprintf(
/* translators: 1: PHP class name, 2: version number, 3: __construct() method */
__( 'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
$class,
$version,
@@ -4901,8 +4904,8 @@ function _doing_it_wrong( $function, $message, $version ) {
/* translators: %s: version number */
$version = sprintf( __( '(This message was added in version %s.)' ), $version );
}
/* translators: %s: Documentation URL */
$message .= ' ' . sprintf(
/* translators: %s: Documentation URL */
__( 'Please see <a href="%s">Debugging in WordPress</a> for more information.' ),
__( 'https://wordpress.org/support/article/debugging-in-wordpress/' )
);
@@ -6756,6 +6759,7 @@ All at ###SITENAME###
'message' => $email_change_text,
'headers' => '',
);
// get site name
$site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );