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
+33 -8
View File
@@ -60,6 +60,7 @@ function update_gallery_tab( $tabs ) {
return $tabs;
}
/* translators: %s: number of attachments */
$tabs['gallery'] = sprintf( __( 'Gallery (%s)' ), "<span id='attachments-count'>$attachments</span>" );
return $tabs;
@@ -331,7 +332,7 @@ function media_handle_upload( $file_id, $post_id, $post_data = array(), $overrid
/* translators: 1: audio track title, 2: artist name */
$content .= sprintf( __( '"%1$s" by %2$s.' ), $title, $meta['artist'] );
} else {
/* translators: 1: audio track title */
/* translators: %s: audio track title */
$content .= sprintf( __( '"%s".' ), $title );
}
} elseif ( ! empty( $meta['album'] ) ) {
@@ -1601,7 +1602,10 @@ function get_media_item( $attachment_id, $args = null ) {
<tbody>
<tr><td colspan='2' class='imgedit-response' id='imgedit-response-$post->ID'></td></tr>\n
<tr><td style='display:none' colspan='2' class='image-editor' id='image-editor-$post->ID'></td></tr>\n
<tr><td colspan='2'><p class='media-types media-types-required-info'>" . sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . "</p></td></tr>\n";
<tr><td colspan='2'><p class='media-types media-types-required-info'>" .
/* translators: %s: an asterisk symbol (*) */
sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) .
"</p></td></tr>\n";
$defaults = array(
'input' => 'text',
@@ -1906,8 +1910,10 @@ function get_compat_media_markup( $attachment_id, $args = null ) {
if ( $item ) {
$item = '<p class="media-types media-types-required-info">' .
sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . '</p>
<table class="compat-attachment-fields">' . $item . '</table>';
/* translators: %s: an asterisk symbol (*) */
sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) .
'</p>' .
'<table class="compat-attachment-fields">' . $item . '</table>';
}
foreach ( $hidden_fields as $hidden_field => $value ) {
@@ -1956,7 +1962,11 @@ function media_upload_form( $errors = null ) {
global $type, $tab, $is_IE, $is_opera;
if ( ! _device_can_upload() ) {
echo '<p>' . sprintf( __( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.' ), 'https://apps.wordpress.org/' ) . '</p>';
echo '<p>' . sprintf(
/* translators: %s: https://apps.wordpress.org/ */
__( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.' ),
'https://apps.wordpress.org/'
) . '</p>';
return;
}
@@ -2130,7 +2140,12 @@ wpUploaderInit = <?php echo wp_json_encode( $plupload_init ); ?>;
?>
</div>
<p class="max-upload-size"><?php printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) ); ?></p>
<p class="max-upload-size">
<?php
/* translators: %s: maximum allowed file size */
printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) );
?>
</p>
<?php
/**
@@ -2775,7 +2790,10 @@ function wp_media_insert_url_form( $default_view = 'image' ) {
return '
<p class="media-types"><label><input type="radio" name="media_type" value="image" id="image-only"' . checked( 'image-only', $view, false ) . ' /> ' . __( 'Image' ) . '</label> &nbsp; &nbsp; <label><input type="radio" name="media_type" value="generic" id="not-image"' . checked( 'not-image', $view, false ) . ' /> ' . __( 'Audio, Video, or Other File' ) . '</label></p>
<p class="media-types media-types-required-info">' . sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . '</p>
<p class="media-types media-types-required-info">' .
/* translators: %s: an asterisk symbol (*) */
sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) .
'</p>
<table class="describe ' . $table_class . '"><tbody>
<tr>
<th scope="row" class="label" style="width:130px;">
@@ -2862,7 +2880,14 @@ function media_upload_flash_bypass() {
?>
<p class="upload-flash-bypass">
<?php printf( __( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" target="%2$s">browser uploader</a> instead.' ), $browser_uploader, '_blank' ); ?>
<?php
printf(
/* translators: 1: URL to browser uploader, 2: additional link attributes */
__( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" %2$s>browser uploader</a> instead.' ),
$browser_uploader,
'target="_blank"'
);
?>
</p>
<?php
}