mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 15:47:05 +00:00
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:
@@ -661,9 +661,23 @@ class WP_List_Table {
|
||||
$approved_comments_number = number_format_i18n( $approved_comments );
|
||||
$pending_comments_number = number_format_i18n( $pending_comments );
|
||||
|
||||
$approved_only_phrase = sprintf( _n( '%s comment', '%s comments', $approved_comments ), $approved_comments_number );
|
||||
$approved_phrase = sprintf( _n( '%s approved comment', '%s approved comments', $approved_comments ), $approved_comments_number );
|
||||
$pending_phrase = sprintf( _n( '%s pending comment', '%s pending comments', $pending_comments ), $pending_comments_number );
|
||||
$approved_only_phrase = sprintf(
|
||||
/* translators: %s: number of comments */
|
||||
_n( '%s comment', '%s comments', $approved_comments ),
|
||||
$approved_comments_number
|
||||
);
|
||||
|
||||
$approved_phrase = sprintf(
|
||||
/* translators: %s: number of comments */
|
||||
_n( '%s approved comment', '%s approved comments', $approved_comments ),
|
||||
$approved_comments_number
|
||||
);
|
||||
|
||||
$pending_phrase = sprintf(
|
||||
/* translators: %s: number of comments */
|
||||
_n( '%s pending comment', '%s pending comments', $pending_comments ),
|
||||
$pending_comments_number
|
||||
);
|
||||
|
||||
// No comments at all.
|
||||
if ( ! $approved_comments && ! $pending_comments ) {
|
||||
@@ -790,7 +804,11 @@ class WP_List_Table {
|
||||
$this->screen->render_screen_reader_content( 'heading_pagination' );
|
||||
}
|
||||
|
||||
$output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
|
||||
$output = '<span class="displaying-num">' . sprintf(
|
||||
/* translators: %s: number of items */
|
||||
_n( '%s item', '%s items', $total_items ),
|
||||
number_format_i18n( $total_items )
|
||||
) . '</span>';
|
||||
|
||||
$current = $this->get_pagenum();
|
||||
$removable_query_args = wp_removable_query_args();
|
||||
@@ -858,7 +876,12 @@ class WP_List_Table {
|
||||
);
|
||||
}
|
||||
$html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
|
||||
$page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;
|
||||
$page_links[] = $total_pages_before . sprintf(
|
||||
/* translators: 1: current page, 2: total pages */
|
||||
_x( '%1$s of %2$s', 'paging' ),
|
||||
$html_current_page,
|
||||
$html_total_pages
|
||||
) . $total_pages_after;
|
||||
|
||||
if ( $disable_next ) {
|
||||
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">›</span>';
|
||||
@@ -1374,6 +1397,7 @@ class WP_List_Table {
|
||||
|
||||
if ( isset( $this->_pagination_args['total_items'] ) ) {
|
||||
$response['total_items_i18n'] = sprintf(
|
||||
/* translators: number of items */
|
||||
_n( '%s item', '%s items', $this->_pagination_args['total_items'] ),
|
||||
number_format_i18n( $this->_pagination_args['total_items'] )
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user