WordPress.org

Make WordPress Core


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

    r45674 r45926  
    112112        $help_install = '<p>' . __( 'Installing themes on Multisite can only be done from the Network Admin section.' ) . '</p>';
    113113    } else {
    114         $help_install = '<p>' . sprintf( __( 'If you would like to see more themes to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional themes from the <a href="%s">WordPress Theme Directory</a>. Themes in the WordPress Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!' ), __( 'https://wordpress.org/themes/' ) ) . '</p>';
     114        $help_install = '<p>' . sprintf(
     115            /* translators: %s: https://wordpress.org/themes/ */
     116            __( 'If you would like to see more themes to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional themes from the <a href="%s">WordPress Theme Directory</a>. Themes in the WordPress Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!' ),
     117            __( 'https://wordpress.org/themes/' )
     118        ) . '</p>';
    115119    }
    116120
     
    168172            'search'            => __( 'Search Installed Themes' ),
    169173            'searchPlaceholder' => __( 'Search installed themes...' ), // placeholder (no ellipsis)
     174            /* translators: %d: number of themes */
    170175            'themesFound'       => __( 'Number of Themes found: %d' ),
    171176            'noThemesFound'     => __( 'No themes found. Try a different search.' ),
     
    328333
    329334    <span class="more-details" id="<?php echo $aria_action; ?>"><?php _e( 'Theme Details' ); ?></span>
    330     <div class="theme-author"><?php printf( __( 'By %s' ), $theme['author'] ); ?></div>
     335    <div class="theme-author">
     336        <?php
     337        /* translators: %s: Theme author name */
     338        printf( __( 'By %s' ), $theme['author'] );
     339        ?>
     340    </div>
    331341
    332342    <div class="theme-id-container">
     
    334344            <h2 class="theme-name" id="<?php echo $aria_name; ?>">
    335345                <?php
    336                 /* translators: %s: theme name */
     346                /* translators: %s: Theme name */
    337347                printf( __( '<span>Active:</span> %s' ), $theme['name'] );
    338348                ?>
     
    547557                    <span class="current-label"><?php _e( 'Current Theme' ); ?></span>
    548558                <# } #>
    549                 <h2 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></span></h2>
    550                 <p class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?></p>
     559                <h2 class="theme-name">{{{ data.name }}}<span class="theme-version">
     560                    <?php
     561                    /* translators: %s: Theme version */
     562                    printf( __( 'Version: %s' ), '{{ data.version }}' );
     563                    ?>
     564                </span></h2>
     565                <p class="theme-author">
     566                    <?php
     567                    /* translators: %s: Theme author link */
     568                    printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' );
     569                    ?>
     570                </p>
    551571
    552572                <# if ( data.hasUpdate ) { #>
     
    559579
    560580                <# if ( data.parent ) { #>
    561                     <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p>
     581                    <p class="parent-theme">
     582                        <?php
     583                        /* translators: %s: Theme name */
     584                        printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' );
     585                        ?>
     586                    </p>
    562587                <# } #>
    563588
Note: See TracChangeset for help on using the changeset viewer.