Make WordPress Core


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

    r45881 r45926  
    532532    ?>
    533533<div class="hidden" id="trash-undo-holder">
    534     <div class="trash-undo-inside"><?php printf( __( 'Comment by %s moved to the trash.' ), '<strong></strong>' ); ?> <span class="undo untrash"><a href="#"><?php _e( 'Undo' ); ?></a></span></div>
     534    <div class="trash-undo-inside">
     535        <?php
     536        /* translators: %s: comment author, filled by AJAX */
     537        printf( __( 'Comment by %s moved to the trash.' ), '<strong></strong>' );
     538        ?>
     539        <span class="undo untrash"><a href="#"><?php _e( 'Undo' ); ?></a></span>
     540    </div>
    535541</div>
    536542<div class="hidden" id="spam-undo-holder">
    537     <div class="spam-undo-inside"><?php printf( __( 'Comment by %s marked as spam.' ), '<strong></strong>' ); ?> <span class="undo unspam"><a href="#"><?php _e( 'Undo' ); ?></a></span></div>
     543    <div class="spam-undo-inside">
     544        <?php
     545        /* translators: %s: comment author, filled by AJAX */
     546        printf( __( 'Comment by %s marked as spam.' ), '<strong></strong>' );
     547        ?>
     548        <span class="undo unspam"><a href="#"><?php _e( 'Undo' ); ?></a></span>
     549    </div>
    538550</div>
    539551    <?php
     
    956968<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) ); ?>">
    957969<p>
    958 <label for="upload"><?php _e( 'Choose a file from your computer:' ); ?></label> (<?php printf( __( 'Maximum size: %s' ), $size ); ?>)
     970        <?php
     971        printf(
     972            '<label for="upload">%s</label> (%s)',
     973            __( 'Choose a file from your computer:' ),
     974            /* translators: %s: maximum allowed file size */
     975            sprintf( __( 'Maximum size: %s' ), $size )
     976        );
     977        ?>
    959978<input type="file" id="upload" name="import" size="25" />
    960979<input type="hidden" name="action" value="save" />
     
    12901309
    12911310                        echo '<button type="button" class="handlediv" aria-expanded="true">';
    1292                         echo '<span class="screen-reader-text">' . sprintf( __( 'Toggle panel: %s' ), $widget_title ) . '</span>';
     1311                        echo '<span class="screen-reader-text">' . sprintf(
     1312                            /* translators: meta box title */
     1313                            __( 'Toggle panel: %s' ),
     1314                            $widget_title
     1315                        ) . '</span>';
    12931316                        echo '<span class="toggle-indicator" aria-hidden="true"></span>';
    12941317                        echo '</button>';
     
    14901513            __FUNCTION__,
    14911514            '3.0.0',
    1492             /* translators: %s: misc */
    14931515            sprintf(
     1516                /* translators: %s: misc */
    14941517                __( 'The "%s" options group has been removed. Use another settings group.' ),
    14951518                'misc'
     
    15031526            __FUNCTION__,
    15041527            '3.5.0',
    1505             /* translators: %s: privacy */
    15061528            sprintf(
     1529                /* translators: %s: privacy */
    15071530                __( 'The "%s" options group has been removed. Use another settings group.' ),
    15081531                'privacy'
     
    15611584            __FUNCTION__,
    15621585            '3.0.0',
    1563             /* translators: %s: misc */
    15641586            sprintf(
     1587                /* translators: %s: misc */
    15651588                __( 'The "%s" options group has been removed. Use another settings group.' ),
    15661589                'misc'
     
    15741597            __FUNCTION__,
    15751598            '3.5.0',
    1576             /* translators: %s: privacy */
    15771599            sprintf(
     1600                /* translators: %s: privacy */
    15781601                __( 'The "%s" options group has been removed. Use another settings group.' ),
    15791602                'privacy'
Note: See TracChangeset for help on using the changeset viewer.