WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/11/2018 04:43:59 PM (4 years ago)
Author:
SergeyBiryukov
Message:

I18N: Use the actual placeholder instead of a number in translator comments if the corresponding string does not use numbered placeholders.

Add missing translator comments in WP_Theme_Install_List_Table and wp_notify_postauthor().
Add missing commas in some translator comments.

Fixes #43523.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-theme-install-list-table.php

    r42343 r42827  
    265265        $author = wp_kses( $theme->author, $themes_allowedtags );
    266266
     267        /* translators: %s: theme name */
    267268        $preview_title = sprintf( __( 'Preview “%s”' ), $name );
    268269        $preview_url   = add_query_arg(
     
    293294        switch ( $status ) {
    294295            case 'update_available':
    295                 $actions[] = '<a class="install-now" href="' . esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ) . '">' . __( 'Update' ) . '</a>';
     296                $actions[] = sprintf(
     297                    '<a class="install-now" href="%s" title="%s">%s</a>',
     298                    esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ),
     299                    /* translators: %s: theme version */
     300                    esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ),
     301                    __( 'Update' )
     302                );
    296303                break;
    297304            case 'newer_installed':
    298305            case 'latest_installed':
    299                 $actions[] = '<span class="install-now" title="' . esc_attr__( 'This theme is already installed and is up to date' ) . '">' . _x( 'Installed', 'theme' ) . '</span>';
     306                $actions[] = sprintf(
     307                    '<span class="install-now" title="%s">%s</span>',
     308                    esc_attr__( 'This theme is already installed and is up to date' ),
     309                    _x( 'Installed', 'theme' )
     310                );
    300311                break;
    301312            case 'install':
    302313            default:
    303                 $actions[] = '<a class="install-now" href="' . esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Install %s' ), $name ) ) . '">' . __( 'Install Now' ) . '</a>';
    304                 break;
    305         }
    306 
    307         $actions[] = '<a class="install-theme-preview" href="' . esc_url( $preview_url ) . '" title="' . esc_attr( sprintf( __( 'Preview %s' ), $name ) ) . '">' . __( 'Preview' ) . '</a>';
     314                $actions[] = sprintf(
     315                    '<a class="install-now" href="%s" title="%s">%s</a>',
     316                    esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ),
     317                    /* translators: %s: theme name */
     318                    esc_attr( sprintf( __( 'Install %s' ), $name ) ),
     319                    __( 'Install Now' )
     320                );
     321                break;
     322        }
     323
     324        $actions[] = sprintf(
     325            '<a class="install-theme-preview" href="%s" title="%s">%s</a>',
     326            esc_url( $preview_url ),
     327            /* translators: %s: theme name */
     328            esc_attr( sprintf( __( 'Preview %s' ), $name ) ),
     329            __( 'Preview' )
     330        );
    308331
    309332        /**
     
    324347
    325348        <h3><?php echo $name; ?></h3>
    326         <div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div>
     349        <div class="theme-author"><?php
     350            /* translators: %s: theme author */
     351            printf( __( 'By %s' ), $author );
     352        ?></div>
    327353
    328354        <div class="action-links">
     
    422448        switch ( $status ) {
    423449            case 'update_available':
    424                 echo '<a class="theme-install button button-primary" href="' . esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ) . '">' . __( 'Update' ) . '</a>';
     450                printf(
     451                    '<a class="theme-install button button-primary" href="%s" title="%s">%s</a>',
     452                    esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ),
     453                    /* translators: %s: theme version */
     454                    esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ),
     455                    __( 'Update' )
     456                );
    425457                break;
    426458            case 'newer_installed':
    427459            case 'latest_installed':
    428                 echo '<span class="theme-install" title="' . esc_attr__( 'This theme is already installed and is up to date' ) . '">' . _x( 'Installed', 'theme' ) . '</span>';
     460                printf(
     461                    '<span class="theme-install" title="%s">%s</span>',
     462                    esc_attr__( 'This theme is already installed and is up to date' ),
     463                    _x( 'Installed', 'theme' )
     464                );
    429465                break;
    430466            case 'install':
    431467            default:
    432                 echo '<a class="theme-install button button-primary" href="' . esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ) . '">' . __( 'Install' ) . '</a>';
     468                printf(
     469                    '<a class="theme-install button button-primary" href="%s">%s</a>',
     470                    esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ),
     471                    __( 'Install' )
     472                );
    433473                break;
    434474        }
    435475            ?>
    436476            <h3 class="theme-name"><?php echo $name; ?></h3>
    437             <span class="theme-by"><?php printf( __( 'By %s' ), $author ); ?></span>
     477            <span class="theme-by"><?php
     478                /* translators: %s: theme author */
     479                printf( __( 'By %s' ), $author );
     480            ?></span>
    438481            <?php if ( isset( $theme->screenshot_url ) ) : ?>
    439482                <img class="theme-screenshot" src="<?php echo esc_url( $theme->screenshot_url ); ?>" alt="" />
Note: See TracChangeset for help on using the changeset viewer.