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-admin/includes/class-theme-upgrader-skin.php

    r45583 r45926  
    6565                admin_url( 'customize.php' )
    6666            );
     67
    6768            if ( get_stylesheet() == $stylesheet ) {
    6869                if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
    69                     $update_actions['preview']  = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize">';
    70                     $update_actions['preview'] .= '<span aria-hidden="true">' . __( 'Customize' ) . '</span>';
    71                     /* translators: %s: theme name */
    72                     $update_actions['preview'] .= '<span class="screen-reader-text">' . sprintf( __( 'Customize &#8220;%s&#8221;' ), $name ) . '</span></a>';
     70                    $update_actions['preview'] = sprintf(
     71                        '<a href="%s" class="hide-if-no-customize load-customize">' .
     72                        '<span aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
     73                        esc_url( $customize_url ),
     74                        __( 'Customize' ),
     75                        /* translators: %s: theme name */
     76                        sprintf( __( 'Customize &#8220;%s&#8221;' ), $name )
     77                    );
    7378                }
    7479            } elseif ( current_user_can( 'switch_themes' ) ) {
    7580                if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
    76                     $update_actions['preview']  = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize">';
    77                     $update_actions['preview'] .= '<span aria-hidden="true">' . __( 'Live Preview' ) . '</span>';
     81                    $update_actions['preview'] = sprintf(
     82                        '<a href="%s" class="hide-if-no-customize load-customize">' .
     83                        '<span aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
     84                        esc_url( $customize_url ),
     85                        __( 'Live Preview' ),
     86                        /* translators: %s: theme name */
     87                        sprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name )
     88                    );
     89                }
     90
     91                $update_actions['activate'] = sprintf(
     92                    '<a href="%s" class="activatelink">' .
     93                    '<span aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
     94                    esc_url( $activate_link ),
     95                    __( 'Activate' ),
    7896                    /* translators: %s: theme name */
    79                     $update_actions['preview'] .= '<span class="screen-reader-text">' . sprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name ) . '</span></a>';
    80                 }
    81                 $update_actions['activate']  = '<a href="' . esc_url( $activate_link ) . '" class="activatelink">';
    82                 $update_actions['activate'] .= '<span aria-hidden="true">' . __( 'Activate' ) . '</span>';
    83                 /* translators: %s: theme name */
    84                 $update_actions['activate'] .= '<span class="screen-reader-text">' . sprintf( __( 'Activate &#8220;%s&#8221;' ), $name ) . '</span></a>';
     97                    sprintf( __( 'Activate &#8220;%s&#8221;' ), $name )
     98                );
    8599            }
    86100
     
    90104        }
    91105
    92         $update_actions['themes_page'] = '<a href="' . self_admin_url( 'themes.php' ) . '" target="_parent">' . __( 'Return to Themes page' ) . '</a>';
     106        $update_actions['themes_page'] = sprintf(
     107            '<a href="%s" target="_parent">%s</a>',
     108            self_admin_url( 'themes.php' ),
     109            __( 'Return to Themes page' )
     110        );
    93111
    94112        /**
Note: See TracChangeset for help on using the changeset viewer.