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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50705 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
David Baumwald
2021-04-13 17:36:39 +00:00
parent 396bb2927b
commit 8b74b031c5
2 changed files with 5 additions and 5 deletions

View File

@@ -221,8 +221,8 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
);
$table = '<table class="update-from-upload-comparison"><tbody>';
$table .= '<tr><th></th><th>' . esc_html( __( 'Current' ) ) . '</th>';
$table .= '<th>' . esc_html( __( 'Uploaded' ) ) . '</th></tr>';
$table .= '<tr><th></th><th>' . esc_html_x( 'Current', 'plugin' ) . '</th>';
$table .= '<th>' . esc_html_x( 'Uploaded', 'plugin' ) . '</th></tr>';
$is_same_plugin = true; // Let's consider only these rows.
@@ -310,7 +310,7 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
$install_actions['overwrite_plugin'] = sprintf(
'<a class="button button-primary update-from-upload-overwrite" href="%s" target="_parent">%s</a>',
wp_nonce_url( add_query_arg( 'overwrite', $overwrite, $this->url ), 'plugin-upload' ),
__( 'Replace current with uploaded' )
_x( 'Replace current with uploaded', 'plugin' )
);
} else {
echo $blocked_message;

View File

@@ -245,7 +245,7 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
);
$table = '<table class="update-from-upload-comparison"><tbody>';
$table .= '<tr><th></th><th>' . esc_html( __( 'Current' ) ) . '</th><th>' . esc_html( __( 'Uploaded' ) ) . '</th></tr>';
$table .= '<tr><th></th><th>' . esc_html_x( 'Current', 'theme' ) . '</th><th>' . esc_html_x( 'Uploaded', 'theme' ) . '</th></tr>';
$is_same_theme = true; // Let's consider only these rows.
@@ -345,7 +345,7 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
$install_actions['overwrite_theme'] = sprintf(
'<a class="button button-primary update-from-upload-overwrite" href="%s" target="_parent">%s</a>',
wp_nonce_url( add_query_arg( 'overwrite', $overwrite, $this->url ), 'theme-upload' ),
__( 'Replace current with uploaded' )
_x( 'Replace current with uploaded', 'theme' )
);
} else {
echo $blocked_message;