WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/01/2019 05:12:43 PM (7 weeks ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r45737 r45926  
    662662        $pending_comments_number  = number_format_i18n( $pending_comments );
    663663
    664         $approved_only_phrase = sprintf( _n( '%s comment', '%s comments', $approved_comments ), $approved_comments_number );
    665         $approved_phrase      = sprintf( _n( '%s approved comment', '%s approved comments', $approved_comments ), $approved_comments_number );
    666         $pending_phrase       = sprintf( _n( '%s pending comment', '%s pending comments', $pending_comments ), $pending_comments_number );
     664        $approved_only_phrase = sprintf(
     665            /* translators: %s: number of comments */
     666            _n( '%s comment', '%s comments', $approved_comments ),
     667            $approved_comments_number
     668        );
     669
     670        $approved_phrase = sprintf(
     671            /* translators: %s: number of comments */
     672            _n( '%s approved comment', '%s approved comments', $approved_comments ),
     673            $approved_comments_number
     674        );
     675
     676        $pending_phrase = sprintf(
     677            /* translators: %s: number of comments */
     678            _n( '%s pending comment', '%s pending comments', $pending_comments ),
     679            $pending_comments_number
     680        );
    667681
    668682        // No comments at all.
     
    791805        }
    792806
    793         $output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
     807        $output = '<span class="displaying-num">' . sprintf(
     808            /* translators: %s: number of items */
     809            _n( '%s item', '%s items', $total_items ),
     810            number_format_i18n( $total_items )
     811        ) . '</span>';
    794812
    795813        $current              = $this->get_pagenum();
     
    859877        }
    860878        $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
    861         $page_links[]     = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;
     879        $page_links[]     = $total_pages_before . sprintf(
     880            /* translators: 1: current page, 2: total pages */
     881            _x( '%1$s of %2$s', 'paging' ),
     882            $html_current_page,
     883            $html_total_pages
     884        ) . $total_pages_after;
    862885
    863886        if ( $disable_next ) {
     
    13751398        if ( isset( $this->_pagination_args['total_items'] ) ) {
    13761399            $response['total_items_i18n'] = sprintf(
     1400                /* translators: number of items */
    13771401                _n( '%s item', '%s items', $this->_pagination_args['total_items'] ),
    13781402                number_format_i18n( $this->_pagination_args['total_items'] )
Note: See TracChangeset for help on using the changeset viewer.