WordPress.org

Make WordPress Core


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

    r45734 r45926  
    945945        apply_filters(
    946946            'wpmu_signup_blog_notification_email',
     947            /* translators: New site notification email. 1: Activation URL, 2: New site URL */
    947948            __( "To activate your blog, please click the following link:\n\n%1\$s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your site here:\n\n%2\$s" ),
    948949            $domain,
     
    958959        $key
    959960    );
     961
    960962    // TODO: Don't hard code activation link.
    961963    $subject = sprintf(
     
    989991        esc_url( 'http://' . $domain . $path )
    990992    );
     993
    991994    wp_mail( $user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
    992995
     
    10611064        apply_filters(
    10621065            'wpmu_signup_user_notification_email',
     1066            /* translators: New user notification email. %s: Activation URL */
    10631067            __( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login." ),
    10641068            $user_login,
     
    10691073        site_url( "wp-activate.php?key=$key" )
    10701074    );
     1075
    10711076    // TODO: Don't hard code activation link.
    10721077    $subject = sprintf(
     
    10941099        $user_login
    10951100    );
     1101
    10961102    wp_mail( $user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
    10971103
     
    13791385    restore_current_blog();
    13801386
    1381     /* translators: New site notification email. 1: Site URL, 2: User IP address, 3: Settings screen URL */
    13821387    $msg = sprintf(
     1388        /* translators: New site notification email. 1: Site URL, 2: User IP address, 3: Settings screen URL */
    13831389        __(
    13841390            'New Site: %1$s
     
    14031409    $msg = apply_filters( 'newblog_notify_siteadmin', $msg );
    14041410
     1411    /* translators: New site notification email subject. %s: New site URL */
    14051412    wp_mail( $email, sprintf( __( 'New Site Registration: %s' ), $siteurl ), $msg );
     1413
    14061414    return true;
    14071415}
     
    14321440
    14331441    $options_site_url = esc_url( network_admin_url( 'settings.php' ) );
    1434     /* translators: New user notification email. 1: User login, 2: User IP address, 3: Settings screen URL */
     1442
    14351443    $msg = sprintf(
     1444        /* translators: New user notification email. 1: User login, 2: User IP address, 3: Settings screen URL */
    14361445        __(
    14371446            'New User: %1$s
     
    14551464     */
    14561465    $msg = apply_filters( 'newuser_notify_siteadmin', $msg, $user );
     1466
     1467    /* translators: New user notification email subject. %s: User login */
    14571468    wp_mail( $email, sprintf( __( 'New User Registration: %s' ), $user->user_login ), $msg );
     1469
    14581470    return true;
    14591471}
     
    16141626     */
    16151627    $subject = apply_filters( 'update_welcome_subject', sprintf( $subject, $current_network->site_name, wp_unslash( $title ) ) );
     1628
    16161629    wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
    16171630
     
    17051718     */
    17061719    $subject = apply_filters( 'update_welcome_user_subject', sprintf( $subject, $current_network->site_name, $user->user_login ) );
     1720
    17071721    wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
    17081722
     
    20762090
    20772091    if ( empty( $details ) || is_wp_error( add_existing_user_to_blog( $details ) ) ) {
    2078         wp_die( sprintf( __( 'An error occurred adding you to this site. Back to the <a href="%s">homepage</a>.' ), home_url() ) );
    2079     }
    2080 
    2081     wp_die( sprintf( __( 'You have been added to this site. Please visit the <a href="%1$s">homepage</a> or <a href="%2$s">log in</a> using your username and password.' ), home_url(), admin_url() ), __( 'WordPress &rsaquo; Success' ), array( 'response' => 200 ) );
     2092        wp_die(
     2093            sprintf(
     2094                /* translators: %s: Home URL */
     2095                __( 'An error occurred adding you to this site. Back to the <a href="%s">homepage</a>.' ),
     2096                home_url()
     2097            )
     2098        );
     2099    }
     2100
     2101    wp_die(
     2102        sprintf(
     2103            /* translators: 1: Home URL, 2: Admin URL */
     2104            __( 'You have been added to this site. Please visit the <a href="%1$s">homepage</a> or <a href="%2$s">log in</a> using your username and password.' ),
     2105            home_url(),
     2106            admin_url()
     2107        ),
     2108        __( 'WordPress &rsaquo; Success' ),
     2109        array( 'response' => 200 )
     2110    );
    20822111}
    20832112
     
    26522681    $content      = str_replace( '###SITEURL###', network_home_url(), $content );
    26532682
    2654     /* translators: Email change notification email subject. %s: Network title */
    2655     wp_mail( $value, sprintf( __( '[%s] Network Admin Email Change Request' ), wp_specialchars_decode( get_site_option( 'site_name' ), ENT_QUOTES ) ), $content );
     2683    wp_mail(
     2684        $value,
     2685        sprintf(
     2686            /* translators: Email change notification email subject. %s: Network title */
     2687            __( '[%s] Network Admin Email Change Request' ),
     2688            wp_specialchars_decode( get_site_option( 'site_name' ), ENT_QUOTES )
     2689        ),
     2690        $content
     2691    );
    26562692
    26572693    if ( $switched_locale ) {
Note: See TracChangeset for help on using the changeset viewer.