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/class-wp-automatic-updater.php

    r45583 r45926  
    337337            case 'translation':
    338338                $language_item_name = $upgrader->get_name_for_update( $item );
    339                 /* translators: %s: Name of language item */
     339                /* translators: %s: Project name (plugin, theme, or WordPress) */
    340340                $item_name = sprintf( __( 'Translations for %s' ), $language_item_name );
    341                 /* translators: 1: Name of language item, 2: Language */
     341                /* translators: 1: Project name (plugin, theme, or WordPress), 2: Language */
    342342                $skin->feedback( sprintf( __( 'Updating translations for %1$s (%2$s)…' ), $language_item_name, $item->language ) );
    343343                break;
     
    349349        }
    350350
    351         // Boom, This sites about to get a whole new splash of paint!
     351        // Boom, this site's about to get a whole new splash of paint!
    352352        $upgrade_result = $upgrader->upgrade(
    353353            $upgrader_item,
     
    650650        switch ( $type ) {
    651651            case 'success': // We updated.
    652                 /* translators: Site updated notification email subject. 1: Site title, 2: WordPress version number. */
     652                /* translators: Site updated notification email subject. 1: Site title, 2: WordPress version. */
    653653                $subject = __( '[%1$s] Your site has updated to WordPress %2$s' );
    654654                break;
     
    656656            case 'fail':   // We tried to update but couldn't.
    657657            case 'manual': // We can't update (and made no attempt).
    658                 /* translators: Update available notification email subject. 1: Site title, 2: WordPress version number. */
     658                /* translators: Update available notification email subject. 1: Site title, 2: WordPress version. */
    659659                $subject = __( '[%1$s] WordPress %2$s is available. Please update!' );
    660660                break;
     
    677677        switch ( $type ) {
    678678            case 'success':
    679                 /* translators: 1: Home URL, 2: WordPress version */
    680                 $body .= sprintf( __( 'Howdy! Your site at %1$s has been updated automatically to WordPress %2$s.' ), home_url(), $core_update->current );
     679                $body .= sprintf(
     680                    /* translators: 1: Home URL, 2: WordPress version */
     681                    __( 'Howdy! Your site at %1$s has been updated automatically to WordPress %2$s.' ),
     682                    home_url(),
     683                    $core_update->current
     684                );
    681685                $body .= "\n\n";
    682686                if ( ! $newer_version_available ) {
     
    686690                // Can only reference the About screen if their update was successful.
    687691                list( $about_version ) = explode( '-', $core_update->current, 2 );
    688                 /* translators: %s: WordPress core version */
     692                /* translators: %s: WordPress version */
    689693                $body .= sprintf( __( 'For more on version %s, see the About WordPress screen:' ), $about_version );
    690694                $body .= "\n" . admin_url( 'about.php' );
    691695
    692696                if ( $newer_version_available ) {
    693                     /* translators: %s: WordPress core latest version */
     697                    /* translators: %s: WordPress latest version */
    694698                    $body .= "\n\n" . sprintf( __( 'WordPress %s is also now available.' ), $next_user_core_update->current ) . ' ';
    695699                    $body .= __( 'Updating is easy and only takes a few moments:' );
     
    701705            case 'fail':
    702706            case 'manual':
    703                 /* translators: 1: Home URL, 2: WordPress core latest version */
    704                 $body .= sprintf( __( 'Please update your site at %1$s to WordPress %2$s.' ), home_url(), $next_user_core_update->current );
     707                $body .= sprintf(
     708                    /* translators: 1: Home URL, 2: WordPress version */
     709                    __( 'Please update your site at %1$s to WordPress %2$s.' ),
     710                    home_url(),
     711                    $next_user_core_update->current
     712                );
    705713
    706714                $body .= "\n\n";
     
    718726            case 'critical':
    719727                if ( $newer_version_available ) {
    720                     /* translators: 1: Home URL, 2: WordPress core latest version */
    721                     $body .= sprintf( __( 'Your site at %1$s experienced a critical failure while trying to update WordPress to version %2$s.' ), home_url(), $core_update->current );
     728                    $body .= sprintf(
     729                        /* translators: 1: Home URL, 2: WordPress version */
     730                        __( 'Your site at %1$s experienced a critical failure while trying to update WordPress to version %2$s.' ),
     731                        home_url(),
     732                        $core_update->current
     733                    );
    722734                } else {
    723                     /* translators: 1: Home URL, 2: Core update version */
    724                     $body .= sprintf( __( 'Your site at %1$s experienced a critical failure while trying to update to the latest version of WordPress, %2$s.' ), home_url(), $core_update->current );
     735                    $body .= sprintf(
     736                        /* translators: 1: Home URL, 2: WordPress latest version */
     737                        __( 'Your site at %1$s experienced a critical failure while trying to update to the latest version of WordPress, %2$s.' ),
     738                        home_url(),
     739                        $core_update->current
     740                    );
    725741                }
    726742
     
    735751        if ( $critical_support ) {
    736752            // Support offer if available.
    737             /* translators: %s: Support e-mail */
    738             $body .= "\n\n" . sprintf( __( 'The WordPress team is willing to help you. Forward this email to %s and the team will work with you to make sure your site is working.' ), $core_update->support_email );
     753            $body .= "\n\n" . sprintf(
     754                /* translators: %s: Support email address */
     755                __( 'The WordPress team is willing to help you. Forward this email to %s and the team will work with you to make sure your site is working.' ),
     756                $core_update->support_email
     757            );
    739758        } else {
    740759            // Add a note about the support forums.
     
    846865            $result = $this->update_results['core'][0];
    847866            if ( $result->result && ! is_wp_error( $result->result ) ) {
    848                 /* translators: %s: WordPress core version */
     867                /* translators: %s: WordPress version */
    849868                $body[] = sprintf( __( 'SUCCESS: WordPress was successfully updated to %s' ), $result->name );
    850869            } else {
    851                 /* translators: %s: WordPress core version */
     870                /* translators: %s: WordPress version */
    852871                $body[] = sprintf( __( 'FAILED: WordPress failed to update to %s' ), $result->name );
    853872                $failures++;
     
    871890                $body[] = $messages[ $type ];
    872891                foreach ( wp_list_pluck( $success_items, 'name' ) as $name ) {
    873                     /* translators: %s: name of plugin / theme / translations */
     892                    /* translators: %s: name of plugin / theme / translation */
    874893                    $body[] = ' * ' . sprintf( __( 'SUCCESS: %s' ), $name );
    875894                }
     
    886905                foreach ( $this->update_results[ $type ] as $item ) {
    887906                    if ( ! $item->result || is_wp_error( $item->result ) ) {
    888                         /* translators: %s: name of plugin / theme / translations */
     907                        /* translators: %s: name of plugin / theme / translation */
    889908                        $body[] = ' * ' . sprintf( __( 'FAILED: %s' ), $item->name );
    890909                        $failures++;
Note: See TracChangeset for help on using the changeset viewer.