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-includes/class-wp-theme.php

    r45590 r45926  
    227227            $this->headers['Name'] = $this->stylesheet;
    228228            if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet ) ) {
    229                 $this->errors = new WP_Error( 'theme_not_found', sprintf( __( 'The theme directory "%s" does not exist.' ), esc_html( $this->stylesheet ) ) );
     229                $this->errors = new WP_Error(
     230                    'theme_not_found',
     231                    sprintf(
     232                        /* translators: %s: theme directory name */
     233                        __( 'The theme directory "%s" does not exist.' ),
     234                        esc_html( $this->stylesheet )
     235                    )
     236                );
    230237            } else {
    231238                $this->errors = new WP_Error( 'theme_no_stylesheet', __( 'Stylesheet is missing.' ) );
     
    272279
    273280        if ( ! $this->template && $this->stylesheet === $this->headers['Template'] ) {
    274             /* translators: %s: Template */
    275             $this->errors = new WP_Error( 'theme_child_invalid', sprintf( __( 'The theme defines itself as its parent theme. Please check the %s header.' ), '<code>Template</code>' ) );
     281            $this->errors = new WP_Error(
     282                'theme_child_invalid',
     283                sprintf(
     284                    /* translators: %s: Template */
     285                    __( 'The theme defines itself as its parent theme. Please check the %s header.' ),
     286                    '<code>Template</code>'
     287                )
     288            );
    276289            $this->cache_add(
    277290                'theme',
     
    329342            } else {
    330343                // Parent theme is missing.
    331                 $this->errors = new WP_Error( 'theme_no_parent', sprintf( __( 'The parent theme is missing. Please install the "%s" parent theme.' ), esc_html( $this->template ) ) );
     344                $this->errors = new WP_Error(
     345                    'theme_no_parent',
     346                    sprintf(
     347                        /* translators: %s: theme directory name */
     348                        __( 'The parent theme is missing. Please install the "%s" parent theme.' ),
     349                        esc_html( $this->template )
     350                    )
     351                );
    332352                $this->cache_add(
    333353                    'theme',
     
    349369            if ( $_child instanceof WP_Theme && $_child->template == $this->stylesheet ) {
    350370                $_child->parent = null;
    351                 $_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $_child->template ) ) );
     371                $_child->errors = new WP_Error(
     372                    'theme_parent_invalid',
     373                    sprintf(
     374                        /* translators: %s: theme directory name */
     375                        __( 'The "%s" theme is not a valid parent theme.' ),
     376                        esc_html( $_child->template )
     377                    )
     378                );
    352379                $_child->cache_add(
    353380                    'theme',
     
    361388                // The two themes actually reference each other with the Template header.
    362389                if ( $_child->stylesheet == $this->template ) {
    363                     $this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $this->template ) ) );
     390                    $this->errors = new WP_Error(
     391                        'theme_parent_invalid',
     392                        sprintf(
     393                            /* translators: %s: theme directory name */
     394                            __( 'The "%s" theme is not a valid parent theme.' ),
     395                            esc_html( $this->template )
     396                        )
     397                    );
    364398                    $this->cache_add(
    365399                        'theme',
Note: See TracChangeset for help on using the changeset viewer.