I18N: Add context to some plugin and theme strings for consistency.

Props ramiy, audrasjb.
Fixes #50710.

git-svn-id: https://develop.svn.wordpress.org/trunk@48520 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-07-20 23:12:33 +00:00
parent 364759ecb2
commit 5674e7e085
8 changed files with 12 additions and 12 deletions

View File

@ -813,8 +813,8 @@
'aria-label', 'aria-label',
sprintf( sprintf(
/* translators: %s: Plugin name. */ /* translators: %s: Plugin name. */
_x( 'Install %s now', 'plugin' ), _x( 'Install %s now', 'plugin' ),
pluginName pluginName
) )
) )
.text( __( 'Install Now' ) ); .text( __( 'Install Now' ) );

View File

@ -156,7 +156,7 @@ if ( empty( $importers ) ) {
esc_attr( $plugin_slug ), esc_attr( $plugin_slug ),
esc_attr( $data[0] ), esc_attr( $data[0] ),
/* translators: %s: Importer name. */ /* translators: %s: Importer name. */
esc_attr( sprintf( __( 'Install %s now' ), $data[0] ) ), esc_attr( sprintf( _x( 'Install %s now', 'plugin' ), $data[0] ) ),
__( 'Install Now' ) __( 'Install Now' )
); );
} else { } else {

View File

@ -528,7 +528,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
esc_attr( $plugin['slug'] ), esc_attr( $plugin['slug'] ),
esc_url( $status['url'] ), esc_url( $status['url'] ),
/* translators: %s: Plugin name and version. */ /* translators: %s: Plugin name and version. */
esc_attr( sprintf( __( 'Install %s now' ), $name ) ), esc_attr( sprintf( _x( 'Install %s now', 'plugin' ), $name ) ),
esc_attr( $name ), esc_attr( $name ),
__( 'Install Now' ) __( 'Install Now' )
); );
@ -550,7 +550,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
esc_attr( $plugin['slug'] ), esc_attr( $plugin['slug'] ),
esc_url( $status['url'] ), esc_url( $status['url'] ),
/* translators: %s: Plugin name and version. */ /* translators: %s: Plugin name and version. */
esc_attr( sprintf( __( 'Update %s now' ), $name ) ), esc_attr( sprintf( _x( 'Update %s now', 'plugin' ), $name ) ),
esc_attr( $name ), esc_attr( $name ),
__( 'Update Now' ) __( 'Update Now' )
); );

View File

@ -323,7 +323,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
'<a class="install-now" href="%s" title="%s">%s</a>', '<a class="install-now" href="%s" title="%s">%s</a>',
esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ), esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ),
/* translators: %s: Theme name. */ /* translators: %s: Theme name. */
esc_attr( sprintf( __( 'Install %s' ), $name ) ), esc_attr( sprintf( _x( 'Install %s', 'theme' ), $name ) ),
__( 'Install Now' ) __( 'Install Now' )
); );
break; break;

View File

@ -1379,7 +1379,7 @@ function wp_dashboard_plugins_output( $rss, $args = array() ) {
echo '<li class="dashboard-news-plugin"><span>' . __( 'Popular Plugin' ) . ':</span> ' . esc_html( $raw_title ) . echo '<li class="dashboard-news-plugin"><span>' . __( 'Popular Plugin' ) . ':</span> ' . esc_html( $raw_title ) .
'&nbsp;<a href="' . $ilink . '" class="thickbox open-plugin-details-modal" aria-label="' . '&nbsp;<a href="' . $ilink . '" class="thickbox open-plugin-details-modal" aria-label="' .
/* translators: %s: Plugin name. */ /* translators: %s: Plugin name. */
esc_attr( sprintf( __( 'Install %s' ), $raw_title ) ) . '">(' . __( 'Install' ) . ')</a></li>'; esc_attr( sprintf( _x( 'Install %s', 'plugin' ), $raw_title ) ) . '">(' . __( 'Install' ) . ')</a></li>';
$feed->__destruct(); $feed->__destruct();
unset( $feed ); unset( $feed );

View File

@ -240,7 +240,7 @@ function get_theme_update_available( $theme ) {
sprintf( sprintf(
'aria-label="%s" id="update-theme" data-slug="%s"', 'aria-label="%s" id="update-theme" data-slug="%s"',
/* translators: %s: Theme name. */ /* translators: %s: Theme name. */
esc_attr( sprintf( __( 'Update %s now' ), $theme_name ) ), esc_attr( sprintf( _x( 'Update %s now', 'theme' ), $theme_name ) ),
$stylesheet $stylesheet
) )
); );

View File

@ -509,7 +509,7 @@ function wp_plugin_update_row( $file, $plugin_data ) {
sprintf( sprintf(
'class="update-link" aria-label="%s"', 'class="update-link" aria-label="%s"',
/* translators: %s: Plugin name. */ /* translators: %s: Plugin name. */
esc_attr( sprintf( __( 'Update %s now' ), $plugin_name ) ) esc_attr( sprintf( _x( 'Update %s now', 'plugin' ), $plugin_name ) )
) )
); );
} else { } else {
@ -694,7 +694,7 @@ function wp_theme_update_row( $theme_key, $theme ) {
sprintf( sprintf(
'class="update-link" aria-label="%s"', 'class="update-link" aria-label="%s"',
/* translators: %s: Theme name. */ /* translators: %s: Theme name. */
esc_attr( sprintf( __( 'Update %s now' ), $theme['Name'] ) ) esc_attr( sprintf( _x( 'Update %s now', 'theme' ), $theme['Name'] ) )
) )
); );
} }

View File

@ -323,14 +323,14 @@ if ( $tab ) {
<# if ( data.compatible_wp && data.compatible_php ) { #> <# if ( data.compatible_wp && data.compatible_php ) { #>
<?php <?php
/* translators: %s: Theme name. */ /* translators: %s: Theme name. */
$aria_label = sprintf( __( 'Install %s' ), '{{ data.name }}' ); $aria_label = sprintf( _x( 'Install %s', 'theme' ), '{{ data.name }}' );
?> ?>
<a class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}" href="{{ data.install_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Install' ); ?></a> <a class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}" href="{{ data.install_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Install' ); ?></a>
<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button> <button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
<# } else { #> <# } else { #>
<?php <?php
/* translators: %s: Theme name. */ /* translators: %s: Theme name. */
$aria_label = sprintf( __( 'Cannot Install %s' ), '{{ data.name }}' ); $aria_label = sprintf( _x( 'Cannot Install %s', 'theme' ), '{{ data.name }}' );
?> ?>
<a class="button button-primary disabled" data-name="{{ data.name }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Install', 'theme' ); ?></a> <a class="button button-primary disabled" data-name="{{ data.name }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Install', 'theme' ); ?></a>
<button class="button disabled"><?php _e( 'Preview' ); ?></button> <button class="button disabled"><?php _e( 'Preview' ); ?></button>