Make WordPress Core

09/01/2019 05:12:43 PM (5 years ago)

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.

1 edited


  • trunk/src/wp-admin/plugins.php

    r45674 r45926  
    502502        $errmsg = __( 'You cannot delete a plugin while it is active on the main site.' );
    503503    } elseif ( isset( $_GET['charsout'] ) ) {
    504         $errmsg  = sprintf(
     504        $errmsg = sprintf(
     505            /* translators: %d: number of characters */
    505506            _n(
    506507                'The plugin generated %d character of <strong>unexpected output</strong> during activation.',
    542543    if ( is_wp_error( $delete_result ) ) :
    543544        ?>
    544         <div id="message" class="error notice is-dismissible"><p><?php printf( __( 'Plugin could not be deleted due to an error: %s' ), $delete_result->get_error_message() ); ?></p></div>
     545        <div id="message" class="error notice is-dismissible">
     546            <p>
     547                <?php
     548                printf(
     549                    /* translators: %s: error message */
     550                    __( 'Plugin could not be deleted due to an error: %s' ),
     551                    $delete_result->get_error_message()
     552                );
     553                ?>
     554            </p>
     555        </div>
    545556        <?php else : ?>
    546557        <div id="message" class="updated notice is-dismissible">
Note: See TracChangeset for help on using the changeset viewer.