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/includes/class-wp-themes-list-table.php

    r45881 r45926  
    9898        if ( is_multisite() ) {
    9999            if ( current_user_can( 'install_themes' ) && current_user_can( 'manage_network_themes' ) ) {
    100                 printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> or <a href="%2$s">install</a> more themes.' ), network_admin_url( 'site-themes.php?id=' . $blog_id ), network_admin_url( 'theme-install.php' ) );
     100                printf(
     101                    /* translators: 1: URL to Themes tab on Edit Site screen, 2: URL to Add Themes screen */
     102                    __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> or <a href="%2$s">install</a> more themes.' ),
     103                    network_admin_url( 'site-themes.php?id=' . $blog_id ),
     104                    network_admin_url( 'theme-install.php' )
     105                );
    101106
    102107                return;
    103108            } elseif ( current_user_can( 'manage_network_themes' ) ) {
    104                 printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> more themes.' ), network_admin_url( 'site-themes.php?id=' . $blog_id ) );
     109                printf(
     110                    /* translators: %s: URL to Themes tab on Edit Site screen */
     111                    __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%s">enable</a> more themes.' ),
     112                    network_admin_url( 'site-themes.php?id=' . $blog_id )
     113                );
    105114
    106115                return;
     
    109118        } else {
    110119            if ( current_user_can( 'install_themes' ) ) {
    111                 printf( __( 'You only have one theme installed right now. Live a little! You can choose from over 1,000 free themes in the WordPress Theme Directory at any time: just click on the <a href="%s">Install Themes</a> tab above.' ), admin_url( 'theme-install.php' ) );
     120                printf(
     121                    /* translators: %s: URL to Add Themes screen */
     122                    __( 'You only have one theme installed right now. Live a little! You can choose from over 1,000 free themes in the WordPress Theme Directory at any time: just click on the <a href="%s">Install Themes</a> tab above.' ),
     123                    admin_url( 'theme-install.php' )
     124                );
    112125
    113126                return;
     
    115128        }
    116129        // Fallthrough.
    117         printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_site_option( 'site_name' ) );
     130        printf(
     131            /* translators: %s: network title */
     132            __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ),
     133            get_site_option( 'site_name' )
     134        );
    118135    }
    119136
     
    187204
    188205            $actions             = array();
    189             $actions['activate'] = '<a href="' . $activate_link . '" class="activatelink" title="'
    190                 . esc_attr( sprintf( __( 'Activate &#8220;%s&#8221;' ), $title ) ) . '">' . __( 'Activate' ) . '</a>';
     206            $actions['activate'] = sprintf(
     207                '<a href="%s" class="activatelink" title="%s">%s</a>',
     208                $activate_link,
     209                /* translators: %s: theme name */
     210                esc_attr( sprintf( __( 'Activate &#8220;%s&#8221;' ), $title ) ),
     211                __( 'Activate' )
     212            );
    191213
    192214            if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
    193                 $actions['preview'] .= '<a href="' . wp_customize_url( $stylesheet ) . '" class="load-customize hide-if-no-customize">'
    194                     . __( 'Live Preview' ) . '</a>';
     215                $actions['preview'] .= sprintf(
     216                    '<a href="%s" class="load-customize hide-if-no-customize">%s</a>',
     217                    wp_customize_url( $stylesheet ),
     218                    __( 'Live Preview' )
     219                );
    195220            }
    196221
    197222            if ( ! is_multisite() && current_user_can( 'delete_themes' ) ) {
    198                 $actions['delete'] = '<a class="submitdelete deletion" href="' . wp_nonce_url( 'themes.php?action=delete&amp;stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet )
    199                     . '" onclick="' . "return confirm( '" . esc_js( sprintf( __( "You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete." ), $title ) )
    200                     . "' );" . '">' . __( 'Delete' ) . '</a>';
     223                $actions['delete'] = sprintf(
     224                    '<a class="submitdelete deletion" href="%s" onclick="return confirm( \'%s\' );">%s</a>',
     225                    wp_nonce_url( 'themes.php?action=delete&amp;stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet ),
     226                    /* translators: %s: theme name */
     227                    esc_js( sprintf( __( "You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete." ), $title ) ),
     228                    __( 'Delete' )
     229                );
    201230            }
    202231
     
    224253
    225254            <h3><?php echo $title; ?></h3>
    226             <div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div>
     255            <div class="theme-author">
     256                <?php
     257                    /* translators: %s: theme author */
     258                    printf( __( 'By %s' ), $author );
     259                ?>
     260            </div>
    227261            <div class="action-links">
    228262                <ul>
Note: See TracChangeset for help on using the changeset viewer.