Make WordPress Core


Ignore:
Timestamp:
09/01/2019 05:12:43 PM (5 years 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-includes/post.php

    r45915 r45926  
    313313            'public'      => true,
    314314            '_builtin'    => true, /* internal use only. */
    315             'label_count' => _n_noop( 'Published <span class="count">(%s)</span>', 'Published <span class="count">(%s)</span>' ),
     315            /* translators: %s: number of published posts */
     316            'label_count' => _n_noop(
     317                'Published <span class="count">(%s)</span>',
     318                'Published <span class="count">(%s)</span>'
     319            ),
    316320        )
    317321    );
     
    323327            'protected'   => true,
    324328            '_builtin'    => true, /* internal use only. */
    325             'label_count' => _n_noop( 'Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>' ),
     329            /* translators: %s: number of scheduled posts */
     330            'label_count' => _n_noop(
     331                'Scheduled <span class="count">(%s)</span>',
     332                'Scheduled <span class="count">(%s)</span>'
     333            ),
    326334        )
    327335    );
     
    333341            'protected'   => true,
    334342            '_builtin'    => true, /* internal use only. */
    335             'label_count' => _n_noop( 'Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>' ),
     343            /* translators: %s: number of draft posts */
     344            'label_count' => _n_noop(
     345                'Draft <span class="count">(%s)</span>',
     346                'Drafts <span class="count">(%s)</span>'
     347            ),
    336348        )
    337349    );
     
    343355            'protected'   => true,
    344356            '_builtin'    => true, /* internal use only. */
    345             'label_count' => _n_noop( 'Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>' ),
     357            /* translators: %s: number of pending posts */
     358            'label_count' => _n_noop(
     359                'Pending <span class="count">(%s)</span>',
     360                'Pending <span class="count">(%s)</span>'
     361            ),
    346362        )
    347363    );
     
    353369            'private'     => true,
    354370            '_builtin'    => true, /* internal use only. */
    355             'label_count' => _n_noop( 'Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>' ),
     371            /* translators: %s: number of private posts */
     372            'label_count' => _n_noop(
     373                'Private <span class="count">(%s)</span>',
     374                'Private <span class="count">(%s)</span>'
     375            ),
    356376        )
    357377    );
     
    363383            'internal'                  => true,
    364384            '_builtin'                  => true, /* internal use only. */
    365             'label_count'               => _n_noop( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>' ),
     385            /* translators: %s: number of trashed posts */
     386            'label_count'               => _n_noop(
     387                'Trash <span class="count">(%s)</span>',
     388                'Trash <span class="count">(%s)</span>'
     389            ),
    366390            'show_in_admin_status_list' => true,
    367391        )
     
    393417            'internal'            => true,
    394418            '_builtin'            => true, /* internal use only. */
    395             'label_count'         => _n_noop( 'Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>' ),
     419            /* translators: %s: number of pending requests */
     420            'label_count'         => _n_noop(
     421                'Pending <span class="count">(%s)</span>',
     422                'Pending <span class="count">(%s)</span>'
     423            ),
    396424            'exclude_from_search' => false,
    397425        )
     
    404432            'internal'            => true,
    405433            '_builtin'            => true, /* internal use only. */
    406             'label_count'         => _n_noop( 'Confirmed <span class="count">(%s)</span>', 'Confirmed <span class="count">(%s)</span>' ),
     434            /* translators: %s: number of confirmed requests */
     435            'label_count'         => _n_noop(
     436                'Confirmed <span class="count">(%s)</span>',
     437                'Confirmed <span class="count">(%s)</span>'
     438            ),
    407439            'exclude_from_search' => false,
    408440        )
     
    415447            'internal'            => true,
    416448            '_builtin'            => true, /* internal use only. */
    417             'label_count'         => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>' ),
     449            /* translators: %s: number of failed requests */
     450            'label_count'         => _n_noop(
     451                'Failed <span class="count">(%s)</span>',
     452                'Failed <span class="count">(%s)</span>'
     453            ),
    418454            'exclude_from_search' => false,
    419455        )
     
    426462            'internal'            => true,
    427463            '_builtin'            => true, /* internal use only. */
    428             'label_count'         => _n_noop( 'Completed <span class="count">(%s)</span>', 'Completed <span class="count">(%s)</span>' ),
     464            /* translators: %s: number of completed requests */
     465            'label_count'         => _n_noop(
     466                'Completed <span class="count">(%s)</span>',
     467                'Completed <span class="count">(%s)</span>'
     468            ),
    429469            'exclude_from_search' => false,
    430470        )
     
    26512691            __( 'Images' ),
    26522692            __( 'Manage Images' ),
    2653             _n_noop( 'Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>' ),
     2693            /* translators: %s: number of images */
     2694            _n_noop(
     2695                'Image <span class="count">(%s)</span>',
     2696                'Images <span class="count">(%s)</span>'
     2697            ),
    26542698        ),
    26552699        'audio'       => array(
    26562700            __( 'Audio' ),
    26572701            __( 'Manage Audio' ),
    2658             _n_noop( 'Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>' ),
     2702            /* translators: %s: number of audio files */
     2703            _n_noop(
     2704                'Audio <span class="count">(%s)</span>',
     2705                'Audio <span class="count">(%s)</span>'
     2706            ),
    26592707        ),
    26602708        'video'       => array(
    26612709            __( 'Video' ),
    26622710            __( 'Manage Video' ),
    2663             _n_noop( 'Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>' ),
     2711            /* translators: %s: number of video files */
     2712            _n_noop(
     2713                'Video <span class="count">(%s)</span>',
     2714                'Video <span class="count">(%s)</span>'
     2715            ),
    26642716        ),
    26652717        'document'    => array(
    26662718            __( 'Documents' ),
    26672719            __( 'Manage Documents' ),
    2668             _n_noop( 'Document <span class="count">(%s)</span>', 'Documents <span class="count">(%s)</span>' ),
     2720            /* translators: %s: number of documents */
     2721            _n_noop(
     2722                'Document <span class="count">(%s)</span>',
     2723                'Documents <span class="count">(%s)</span>'
     2724            ),
    26692725        ),
    26702726        'spreadsheet' => array(
    26712727            __( 'Spreadsheets' ),
    26722728            __( 'Manage Spreadsheets' ),
    2673             _n_noop( 'Spreadsheet <span class="count">(%s)</span>', 'Spreadsheets <span class="count">(%s)</span>' ),
     2729            /* translators: %s: number of spreadsheets */
     2730            _n_noop(
     2731                'Spreadsheet <span class="count">(%s)</span>',
     2732                'Spreadsheets <span class="count">(%s)</span>'
     2733            ),
    26742734        ),
    26752735        'archive'     => array(
    26762736            __( 'Archives' ),
    26772737            __( 'Manage Archives' ),
    2678             _n_noop( 'Archive <span class="count">(%s)</span>', 'Archives <span class="count">(%s)</span>' ),
     2738            /* translators: %s: number of archives */
     2739            _n_noop(
     2740                'Archive <span class="count">(%s)</span>',
     2741                'Archives <span class="count">(%s)</span>'
     2742            ),
    26792743        ),
    26802744    );
Note: See TracChangeset for help on using the changeset viewer.