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

    r42685 r45926  
    2525$update_data = wp_get_update_data();
    2626if ( $update_data['counts']['total'] ) {
    27     $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' );
     27    $submenu['index.php'][10] = array(
     28        sprintf(
     29            /* translators: %s: number of available updates */
     30            __( 'Updates %s' ),
     31            sprintf(
     32                '<span class="update-plugins count-%s"><span class="update-count">%s</span></span>',
     33                $update_data['counts']['total'],
     34                number_format_i18n( $update_data['counts']['total'] )
     35            )
     36        ),
     37        $cap,
     38        'update-core.php',
     39    );
    2840} else {
    2941    $submenu['index.php'][10] = array( __( 'Updates' ), $cap, 'update-core.php' );
     
    4658
    4759if ( current_user_can( 'update_themes' ) && $update_data['counts']['themes'] ) {
    48     $menu[15] = array( sprintf( __( 'Themes %s' ), "<span class='update-plugins count-{$update_data['counts']['themes']}'><span class='theme-count'>" . number_format_i18n( $update_data['counts']['themes'] ) . '</span></span>' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
     60    $menu[15] = array(
     61        sprintf(
     62            /* translators: %s: number of available theme updates */
     63            __( 'Themes %s' ),
     64            sprintf(
     65                '<span class="update-plugins count-%s"><span class="theme-count">%s</span></span>',
     66                $update_data['counts']['themes'],
     67                number_format_i18n( $update_data['counts']['themes'] )
     68            )
     69        ),
     70        'manage_network_themes',
     71        'themes.php',
     72        '',
     73        'menu-top menu-icon-appearance',
     74        'menu-appearance',
     75        'dashicons-admin-appearance',
     76    );
    4977} else {
    5078    $menu[15] = array( __( 'Themes' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
     
    5583
    5684if ( current_user_can( 'update_plugins' ) && $update_data['counts']['plugins'] ) {
    57     $menu[20] = array( sprintf( __( 'Plugins %s' ), "<span class='update-plugins count-{$update_data['counts']['plugins']}'><span class='plugin-count'>" . number_format_i18n( $update_data['counts']['plugins'] ) . '</span></span>' ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
     85    $menu[20] = array(
     86        sprintf(
     87            /* translators: %s: number of available plugin updates */
     88            __( 'Plugins %s' ),
     89            sprintf(
     90                '<span class="update-plugins count-%s"><span class="plugin-count">%s</span></span>',
     91                $update_data['counts']['plugins'],
     92                number_format_i18n( $update_data['counts']['plugins'] )
     93            )
     94        ),
     95        'manage_network_plugins',
     96        'plugins.php',
     97        '',
     98        'menu-top menu-icon-plugins',
     99        'menu-plugins',
     100        'dashicons-admin-plugins',
     101    );
    58102} else {
    59103    $menu[20] = array( __( 'Plugins' ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
Note: See TracChangeset for help on using the changeset viewer.