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-admin/menu.php

    r45507 r45926  
    4343        $cap = 'update_languages';
    4444    }
    45     /* translators: %s: number of pending updates */
    46     $submenu['index.php'][10] = array( sprintf( __( 'Updates %s' ), "<span class='update-plugins count-{$update_data['counts']['total']}'><span class='update-count'>" . number_format_i18n( $update_data['counts']['total'] ) . '</span></span>' ), $cap, 'update-core.php' );
     45    $submenu['index.php'][10] = array(
     46        sprintf(
     47            /* translators: %s: number of pending updates */
     48            __( 'Updates %s' ),
     49            sprintf(
     50                '<span class="update-plugins count-%s"><span class="update-count">%s</span></span>',
     51                $update_data['counts']['total'],
     52                number_format_i18n( $update_data['counts']['total'] )
     53            )
     54        ),
     55        $cap,
     56        'update-core.php',
     57    );
    4758    unset( $cap );
    4859}
     
    7990    $awaiting_mod      = $awaiting_mod->moderated;
    8091    $awaiting_mod_i18n = number_format_i18n( $awaiting_mod );
    81     /* translators: %s: number of comments in moderation */
     92    /* translators: %s: number of comments */
    8293    $awaiting_mod_text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ), $awaiting_mod_i18n );
    8394
    8495    $menu[25] = array(
    85         /* translators: %s: number of comments in moderation */
     96        /* translators: %s: number of comments */
    8697        sprintf( __( 'Comments %s' ), '<span class="awaiting-mod count-' . absint( $awaiting_mod ) . '"><span class="pending-count" aria-hidden="true">' . $awaiting_mod_i18n . '</span><span class="comments-in-moderation-text screen-reader-text">' . $awaiting_mod_text . '</span></span>' ),
    8798        'edit_posts',
     
    218229        $update_data = wp_get_update_data();
    219230    }
    220     $count = "<span class='update-plugins count-{$update_data['counts']['plugins']}'><span class='plugin-count'>" . number_format_i18n( $update_data['counts']['plugins'] ) . '</span></span>';
     231    $count = sprintf(
     232        '<span class="update-plugins count-%s"><span class="plugin-count">%s</span></span>',
     233        $update_data['counts']['plugins'],
     234        number_format_i18n( $update_data['counts']['plugins'] )
     235    );
    221236}
    222237
Note: See TracChangeset for help on using the changeset viewer.