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/includes/media.php

    r45915 r45926  
    6161    }
    6262
     63    /* translators: %s: number of attachments */
    6364    $tabs['gallery'] = sprintf( __( 'Gallery (%s)' ), "<span id='attachments-count'>$attachments</span>" );
    6465
     
    332333                $content .= sprintf( __( '"%1$s" by %2$s.' ), $title, $meta['artist'] );
    333334            } else {
    334                 /* translators: 1: audio track title */
     335                /* translators: %s: audio track title */
    335336                $content .= sprintf( __( '"%s".' ), $title );
    336337            }
     
    16021603        <tr><td colspan='2' class='imgedit-response' id='imgedit-response-$post->ID'></td></tr>\n
    16031604        <tr><td style='display:none' colspan='2' class='image-editor' id='image-editor-$post->ID'></td></tr>\n
    1604         <tr><td colspan='2'><p class='media-types media-types-required-info'>" . sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . "</p></td></tr>\n";
     1605        <tr><td colspan='2'><p class='media-types media-types-required-info'>" .
     1606            /* translators: %s: an asterisk symbol (*) */
     1607            sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) .
     1608        "</p></td></tr>\n";
    16051609
    16061610    $defaults = array(
     
    19071911    if ( $item ) {
    19081912        $item = '<p class="media-types media-types-required-info">' .
    1909             sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . '</p>
    1910             <table class="compat-attachment-fields">' . $item . '</table>';
     1913            /* translators: %s: an asterisk symbol (*) */
     1914            sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) .
     1915            '</p>' .
     1916            '<table class="compat-attachment-fields">' . $item . '</table>';
    19111917    }
    19121918
     
    19571963
    19581964    if ( ! _device_can_upload() ) {
    1959         echo '<p>' . sprintf( __( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.' ), 'https://apps.wordpress.org/' ) . '</p>';
     1965        echo '<p>' . sprintf(
     1966            /* translators: %s: https://apps.wordpress.org/ */
     1967            __( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.' ),
     1968            'https://apps.wordpress.org/'
     1969        ) . '</p>';
    19601970        return;
    19611971    }
     
    21312141</div>
    21322142
    2133 <p class="max-upload-size"><?php printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) ); ?></p>
     2143<p class="max-upload-size">
     2144    <?php
     2145    /* translators: %s: maximum allowed file size */
     2146    printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) );
     2147    ?>
     2148</p>
    21342149    <?php
    21352150
     
    27762791    return '
    27772792    <p class="media-types"><label><input type="radio" name="media_type" value="image" id="image-only"' . checked( 'image-only', $view, false ) . ' /> ' . __( 'Image' ) . '</label> &nbsp; &nbsp; <label><input type="radio" name="media_type" value="generic" id="not-image"' . checked( 'not-image', $view, false ) . ' /> ' . __( 'Audio, Video, or Other File' ) . '</label></p>
    2778     <p class="media-types media-types-required-info">' . sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . '</p>
     2793    <p class="media-types media-types-required-info">' .
     2794        /* translators: %s: an asterisk symbol (*) */
     2795        sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) .
     2796    '</p>
    27792797    <table class="describe ' . $table_class . '"><tbody>
    27802798        <tr>
     
    28632881    ?>
    28642882    <p class="upload-flash-bypass">
    2865     <?php printf( __( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" target="%2$s">browser uploader</a> instead.' ), $browser_uploader, '_blank' ); ?>
     2883    <?php
     2884        printf(
     2885            /* translators: 1: URL to browser uploader, 2: additional link attributes */
     2886            __( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" %2$s>browser uploader</a> instead.' ),
     2887            $browser_uploader,
     2888            'target="_blank"'
     2889        );
     2890    ?>
    28662891    </p>
    28672892    <?php
Note: See TracChangeset for help on using the changeset viewer.