Make WordPress Core


Ignore:
Timestamp:
08/30/2018 01:35:27 PM (8 years ago)
Author:
jrf
Message:

I18n: Improve translators comments [3].

  • Add missing translators comments.
  • Fix placement of some translators comments. Translators 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 translators comments.

Includes minor code layout fixes.

Patch 44360-wp-admin-includes-dir.patch of the series.

Props flipkeijzer, alvarogois, michielatyoast
See #44360

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-automatic-updater.php

    r43571 r43598  
    308308                switch ( $type ) {
    309309                        case 'core':
     310                                /* translators: %s: WordPress version */
    310311                                $skin->feedback( __( 'Updating to WordPress %s' ), $item->version );
     312                                /* translators: %s: WordPress version */
    311313                                $item_name = sprintf( __( 'WordPress %s' ), $item->version );
    312314                                break;
    … …  
    315317                                $theme         = wp_get_theme( $upgrader_item );
    316318                                $item_name     = $theme->Get( 'Name' );
     319                                /* translators: %s: Theme name */
    317320                                $skin->feedback( __( 'Updating theme: %s' ), $item_name );
    318321                                break;
    … …  
    321324                                $plugin_data   = get_plugin_data( $context . '/' . $upgrader_item );
    322325                                $item_name     = $plugin_data['Name'];
     326                                /* translators: %s: Plugin name */
    323327                                $skin->feedback( __( 'Updating plugin: %s' ), $item_name );
    324328                                break;
    325329                        case 'translation':
    326330                                $language_item_name = $upgrader->get_name_for_update( $item );
    327                                 $item_name          = sprintf( __( 'Translations for %s' ), $language_item_name );
     331                                /* translators: %s: Name of language item */
     332                                $item_name = sprintf( __( 'Translations for %s' ), $language_item_name );
     333                                /* translators: 1: Name of language item, 2: Language */
    328334                                $skin->feedback( sprintf( __( 'Updating translations for %1$s (%2$s)…' ), $language_item_name, $item->language ) );
    329335                                break;
    … …  
    663669                switch ( $type ) {
    664670                        case 'success':
     671                                /* translators: 1: Home URL, 2: WordPress version */
    665672                                $body .= sprintf( __( 'Howdy! Your site at %1$s has been updated automatically to WordPress %2$s.' ), home_url(), $core_update->current );
    666673                                $body .= "\n\n";
    … …  
    671678                                // Can only reference the About screen if their update was successful.
    672679                                list( $about_version ) = explode( '-', $core_update->current, 2 );
    673                                 $body                 .= sprintf( __( 'For more on version %s, see the About WordPress screen:' ), $about_version );
    674                                 $body                 .= "\n" . admin_url( 'about.php' );
     680                                /* translators: %s: WordPress core version */
     681                                $body .= sprintf( __( 'For more on version %s, see the About WordPress screen:' ), $about_version );
     682                                $body .= "\n" . admin_url( 'about.php' );
    675683
    676684                                if ( $newer_version_available ) {
     685                                        /* translators: %s: WordPress core latest version */
    677686                                        $body .= "\n\n" . sprintf( __( 'WordPress %s is also now available.' ), $next_user_core_update->current ) . ' ';
    678687                                        $body .= __( 'Updating is easy and only takes a few moments:' );
    … …  
    684693                        case 'fail':
    685694                        case 'manual':
     695                                /* translators: 1: Home URL, 2: WordPress core latest version */
    686696                                $body .= sprintf( __( 'Please update your site at %1$s to WordPress %2$s.' ), home_url(), $next_user_core_update->current );
    687697
    … …  
    700710                        case 'critical':
    701711                                if ( $newer_version_available ) {
     712                                        /* translators: 1: Home URL, 2: WordPress core latest version */
    702713                                        $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 );
    703714                                } else {
     715                                        /* translators: 1: Home URL, 2: Core update version */
    704716                                        $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 );
    705717                                }
    … …  
    715727                if ( $critical_support ) {
    716728                        // Support offer if available.
     729                        /* translators: %s: Support e-mail */
    717730                        $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 );
    718731                } else {
    … …  
    741754                if ( 'critical' == $type && is_wp_error( $result ) ) {
    742755                        $body .= "\n***\n\n";
     756                        /* translators: %s: WordPress version */
    743757                        $body .= sprintf( __( 'Your site was running version %s.' ), get_bloginfo( 'version' ) );
    744758                        $body .= ' ' . __( 'We have some data that describes the error your site encountered.' );
    … …  
    758772                                }
    759773                                $error_code = $error->get_error_code();
    760                                 $body      .= "\n\n" . sprintf( __( 'Error code: %s' ), $error_code );
     774                                /* translators: %s: Error code */
     775                                $body .= "\n\n" . sprintf( __( 'Error code: %s' ), $error_code );
    761776                                if ( 'rollback_was_required' == $error_code ) {
    762777                                        continue;
    … …  
    816831                $failures = 0;
    817832
     833                /* translators: %s: Network home URL */
    818834                $body[] = sprintf( __( 'WordPress site: %s' ), network_home_url( '/' ) );
    819835
    … …  
    822838                        $result = $this->update_results['core'][0];
    823839                        if ( $result->result && ! is_wp_error( $result->result ) ) {
     840                                /* translators: %s: WordPress core version */
    824841                                $body[] = sprintf( __( 'SUCCESS: WordPress was successfully updated to %s' ), $result->name );
    825842                        } else {
     843                                /* translators: %s: WordPress core version */
    826844                                $body[] = sprintf( __( 'FAILED: WordPress failed to update to %s' ), $result->name );
    827845                                $failures++;
    … …  
    845863                                $body[] = $messages[ $type ];
    846864                                foreach ( wp_list_pluck( $success_items, 'name' ) as $name ) {
     865                                        /* translators: %s: name of plugin / theme / translations */
    847866                                        $body[] = ' * ' . sprintf( __( 'SUCCESS: %s' ), $name );
    848867                                }
    … …  
    859878                                foreach ( $this->update_results[ $type ] as $item ) {
    860879                                        if ( ! $item->result || is_wp_error( $item->result ) ) {
     880                                                /* translators: %s: name of plugin / theme / translations */
    861881                                                $body[] = ' * ' . sprintf( __( 'FAILED: %s' ), $item->name );
    862882                                                $failures++;
    … …  
    885905                        $body[] = '';
    886906
     907                        /* translators: %s: site title */
    887908                        $subject = sprintf( __( '[%s] There were failures during background updates' ), $site_title );
    888909                } else {
     910                        /* translators: %s: site title */
    889911                        $subject = sprintf( __( '[%s] Background updates have finished' ), $site_title );
    890912                }
Note: See TracChangeset for help on using the changeset viewer.