WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/01/2019 05:12:43 PM (3 months 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/theme.php

    r45583 r45926  
    7777
    7878    if ( ! $deleted ) {
    79         return new WP_Error( 'could_not_remove_theme', sprintf( __( 'Could not fully remove the theme %s.' ), $stylesheet ) );
     79        return new WP_Error(
     80            'could_not_remove_theme',
     81            /* translators: %s: Theme name */
     82            sprintf( __( 'Could not fully remove the theme %s.' ), $stylesheet )
     83        );
    8084    }
    8185
     
    196200        if ( ! is_multisite() ) {
    197201            if ( ! current_user_can( 'update_themes' ) ) {
    198                 /* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number */
    199202                $html = sprintf(
     203                    /* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number */
    200204                    '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ) . '</strong></p>',
    201205                    $theme_name,
     
    209213                );
    210214            } elseif ( empty( $update['package'] ) ) {
    211                 /* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number */
    212215                $html = sprintf(
     216                    /* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number */
    213217                    '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ) . '</strong></p>',
    214218                    $theme_name,
     
    222226                );
    223227            } else {
    224                 /* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */
    225228                $html = sprintf(
     229                    /* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */
    226230                    '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ) . '</strong></p>',
    227231                    $theme_name,
     
    718722                        <span class="current-label"><?php _e( 'Current Theme' ); ?></span>
    719723                    <# } #>
    720                     <h2 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></span></h2>
    721                     <h3 class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?></h3>
     724                    <h2 class="theme-name">{{{ data.name }}}<span class="theme-version">
     725                        <?php
     726                        /* translators: %s: theme version */
     727                        printf( __( 'Version: %s' ), '{{ data.version }}' );
     728                        ?>
     729                    </span></h2>
     730                    <h3 class="theme-author">
     731                        <?php
     732                        /* translators: %s: theme author link */
     733                        printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' );
     734                        ?>
     735                    </h3>
    722736
    723737                    <# if ( data.stars && 0 != data.num_ratings ) { #>
     
    746760
    747761                    <# if ( data.parent ) { #>
    748                         <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p>
     762                        <p class="parent-theme">
     763                            <?php
     764                            printf(
     765                                /* translators: %s: theme name */
     766                                __( 'This is a child theme of %s.' ),
     767                                '<strong>{{{ data.parent }}}</strong>'
     768                            );
     769                            ?>
     770                        </p>
    749771                    <# } #>
    750772
Note: See TracChangeset for help on using the changeset viewer.