Make WordPress Core


Ignore:
Timestamp:
08/30/2018 01:35:27 PM (6 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-theme-upgrader-skin.php

    r43571 r43598  
    6666            if ( get_stylesheet() == $stylesheet ) {
    6767                if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
    68                     $update_actions['preview'] = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize"><span aria-hidden="true">' . __( 'Customize' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Customize &#8220;%s&#8221;' ), $name ) . '</span></a>';
     68                    $update_actions['preview']  = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize">';
     69                    $update_actions['preview'] .= '<span aria-hidden="true">' . __( 'Customize' ) . '</span>';
     70                    /* translators: %s: theme name */
     71                    $update_actions['preview'] .= '<span class="screen-reader-text">' . sprintf( __( 'Customize &#8220;%s&#8221;' ), $name ) . '</span></a>';
    6972                }
    7073            } elseif ( current_user_can( 'switch_themes' ) ) {
    7174                if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
    72                     $update_actions['preview'] = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize"><span aria-hidden="true">' . __( 'Live Preview' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name ) . '</span></a>';
     75                    $update_actions['preview']  = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize">';
     76                    $update_actions['preview'] .= '<span aria-hidden="true">' . __( 'Live Preview' ) . '</span>';
     77                    /* translators: %s: theme name */
     78                    $update_actions['preview'] .= '<span class="screen-reader-text">' . sprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name ) . '</span></a>';
    7379                }
    74                 $update_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink"><span aria-hidden="true">' . __( 'Activate' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Activate &#8220;%s&#8221;' ), $name ) . '</span></a>';
     80                $update_actions['activate']  = '<a href="' . esc_url( $activate_link ) . '" class="activatelink">';
     81                $update_actions['activate'] .= '<span aria-hidden="true">' . __( 'Activate' ) . '</span>';
     82                /* translators: %s: theme name */
     83                $update_actions['activate'] .= '<span class="screen-reader-text">' . sprintf( __( 'Activate &#8220;%s&#8221;' ), $name ) . '</span></a>';
    7584            }
    7685
Note: See TracChangeset for help on using the changeset viewer.