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

@@ -1013,7 +1013,10 @@ function wp_check_locked_posts( $response, $data, $screen_id ) {
if ( $user_id ) {
$user = get_userdata( $user_id );
if ( $user && current_user_can( 'edit_post', $post_id ) ) {
$send = array( 'text' => sprintf( __( '%s is currently editing' ), $user->display_name ) );
$send = array(
/* translators: %s: user's display name */
'text' => sprintf( __( '%s is currently editing' ), $user->display_name ),
);
$avatar = get_avatar( $user->ID, 18 );
if ( $avatar && preg_match( "|src='([^']+)'|", $avatar, $matches ) ) {
@@ -1061,6 +1064,7 @@ function wp_refresh_post_lock( $response, $data, $screen_id ) {
$user = get_userdata( $user_id );
if ( $user ) {
$error = array(
/* translators: %s: user's display name */
'text' => sprintf( __( '%s has taken over and is currently editing.' ), $user->display_name ),
);
@@ -1186,9 +1190,9 @@ function heartbeat_autosave( $response, $data ) {
} else {
/* translators: draft saved date format, see https://secure.php.net/date */
$draft_saved_date_format = __( 'g:i:s a' );
/* translators: %s: date and time */
$response['wp_autosave'] = array(
'success' => true,
/* translators: %s: date and time */
'message' => sprintf( __( 'Draft saved at %s.' ), date_i18n( $draft_saved_date_format ) ),
);
}
@@ -1341,8 +1345,15 @@ All at ###SITENAME###
$content = str_replace( '###SITENAME###', wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $content );
$content = str_replace( '###SITEURL###', home_url(), $content );
/* translators: New admin email address notification email subject. %s: Site title */
wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ), $content );
wp_mail(
$value,
sprintf(
/* translators: New admin email address notification email subject. %s: Site title */
__( '[%s] New Admin Email Address' ),
wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )
),
$content
);
if ( $switched_locale ) {
restore_previous_locale();