WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/01/2019 05:12:43 PM (6 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-ms-users-list-table.php

    r45617 r45926  
    140140        $current_link_attributes = $role !== 'super' ? ' class="current" aria-current="page"' : '';
    141141        $role_links              = array();
    142         $role_links['all']       = "<a href='" . network_admin_url( 'users.php' ) . "'$current_link_attributes>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';
     142        $role_links['all']       = sprintf(
     143            '<a href="%s"%s>%s</a>',
     144            network_admin_url( 'users.php' ),
     145            $current_link_attributes,
     146            sprintf(
     147                /* translators: number of users */
     148                _nx(
     149                    'All <span class="count">(%s)</span>',
     150                    'All <span class="count">(%s)</span>',
     151                    $total_users,
     152                    'users'
     153                ),
     154                number_format_i18n( $total_users )
     155            )
     156        );
    143157        $current_link_attributes = $role === 'super' ? ' class="current" aria-current="page"' : '';
    144         $role_links['super']     = "<a href='" . network_admin_url( 'users.php?role=super' ) . "'$current_link_attributes>" . sprintf( _n( 'Super Admin <span class="count">(%s)</span>', 'Super Admins <span class="count">(%s)</span>', $total_admins ), number_format_i18n( $total_admins ) ) . '</a>';
     158        $role_links['super']     = sprintf(
     159            '<a href="%s"%s>%s</a>',
     160            network_admin_url( 'users.php?role=super' ),
     161            $current_link_attributes,
     162            sprintf(
     163                /* translators: number of users */
     164                _n(
     165                    'Super Admin <span class="count">(%s)</span>',
     166                    'Super Admins <span class="count">(%s)</span>',
     167                    $total_admins
     168                ),
     169                number_format_i18n( $total_admins )
     170            )
     171        );
    145172
    146173        return $role_links;
     
    210237        ?>
    211238        <label class="screen-reader-text" for="blog_<?php echo $user->ID; ?>">
    212             <?php printf( __( 'Select %s' ), $user->user_login ); ?>
     239            <?php
     240            /* translators: %s: user login */
     241            printf( __( 'Select %s' ), $user->user_login );
     242            ?>
    213243        </label>
    214244        <input type="checkbox" id="blog_<?php echo $user->ID; ?>" name="allusers[]" value="<?php echo esc_attr( $user->ID ); ?>" />
Note: See TracChangeset for help on using the changeset viewer.