Make WordPress Core


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

    r45735 r45926  
    10141014                $user = get_userdata( $user_id );
    10151015                if ( $user && current_user_can( 'edit_post', $post_id ) ) {
    1016                     $send = array( 'text' => sprintf( __( '%s is currently editing' ), $user->display_name ) );
     1016                    $send = array(
     1017                        /* translators: %s: user's display name */
     1018                        'text' => sprintf( __( '%s is currently editing' ), $user->display_name ),
     1019                    );
    10171020
    10181021                    $avatar = get_avatar( $user->ID, 18 );
     
    10621065        if ( $user ) {
    10631066            $error = array(
     1067                /* translators: %s: user's display name */
    10641068                'text' => sprintf( __( '%s has taken over and is currently editing.' ), $user->display_name ),
    10651069            );
     
    11871191            /* translators: draft saved date format, see https://secure.php.net/date */
    11881192            $draft_saved_date_format = __( 'g:i:s a' );
    1189             /* translators: %s: date and time */
    11901193            $response['wp_autosave'] = array(
    11911194                'success' => true,
     1195                /* translators: %s: date and time */
    11921196                'message' => sprintf( __( 'Draft saved at %s.' ), date_i18n( $draft_saved_date_format ) ),
    11931197            );
     
    13421346    $content      = str_replace( '###SITEURL###', home_url(), $content );
    13431347
    1344     /* translators: New admin email address notification email subject. %s: Site title */
    1345     wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ), $content );
     1348    wp_mail(
     1349        $value,
     1350        sprintf(
     1351            /* translators: New admin email address notification email subject. %s: Site title */
     1352            __( '[%s] New Admin Email Address' ),
     1353            wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )
     1354        ),
     1355        $content
     1356    );
    13461357
    13471358    if ( $switched_locale ) {
Note: See TracChangeset for help on using the changeset viewer.