Make WordPress Core

Changeset 50705


Ignore:
Timestamp:
04/13/2021 05:36:39 PM (4 years ago)
Author:
davidbaumwald
Message:

I18N: Add context to strings when updating a plugin or theme with a ZIP package.

After [48390], plugins and themes can be updated with an uploaded ZIP file. Strings were added for comparing the "current" and "uploaded" versions of a plugin or theme, but lacked context for each as to the object being referenced. This change adds a plugin or theme context to each of these strings for disambiguation.

Props dimadin, SergeyBiryukov.
Fixes #53017.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-plugin-installer-skin.php

    r49675 r50705  
    222222
    223223        $table  = '<table class="update-from-upload-comparison"><tbody>';
    224         $table .= '<tr><th></th><th>' . esc_html( __( 'Current' ) ) . '</th>';
    225         $table .= '<th>' . esc_html( __( 'Uploaded' ) ) . '</th></tr>';
     224        $table .= '<tr><th></th><th>' . esc_html_x( 'Current', 'plugin' ) . '</th>';
     225        $table .= '<th>' . esc_html_x( 'Uploaded', 'plugin' ) . '</th></tr>';
    226226
    227227        $is_same_plugin = true; // Let's consider only these rows.
     
    311311                '<a class="button button-primary update-from-upload-overwrite" href="%s" target="_parent">%s</a>',
    312312                wp_nonce_url( add_query_arg( 'overwrite', $overwrite, $this->url ), 'plugin-upload' ),
    313                 __( 'Replace current with uploaded' )
     313                _x( 'Replace current with uploaded', 'plugin' )
    314314            );
    315315        } else {
  • trunk/src/wp-admin/includes/class-theme-installer-skin.php

    r49675 r50705  
    246246
    247247        $table  = '<table class="update-from-upload-comparison"><tbody>';
    248         $table .= '<tr><th></th><th>' . esc_html( __( 'Current' ) ) . '</th><th>' . esc_html( __( 'Uploaded' ) ) . '</th></tr>';
     248        $table .= '<tr><th></th><th>' . esc_html_x( 'Current', 'theme' ) . '</th><th>' . esc_html_x( 'Uploaded', 'theme' ) . '</th></tr>';
    249249
    250250        $is_same_theme = true; // Let's consider only these rows.
     
    346346                '<a class="button button-primary update-from-upload-overwrite" href="%s" target="_parent">%s</a>',
    347347                wp_nonce_url( add_query_arg( 'overwrite', $overwrite, $this->url ), 'theme-upload' ),
    348                 __( 'Replace current with uploaded' )
     348                _x( 'Replace current with uploaded', 'theme' )
    349349            );
    350350        } else {
Note: See TracChangeset for help on using the changeset viewer.