Themes: Include theme name in available update messages, for better accessibility and consistency with other similar messages.

Follow-up to [48652-48654].

See #48491.
Built from https://develop.svn.wordpress.org/trunk@48659


git-svn-id: http://core.svn.wordpress.org/trunk@48421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-07-28 11:31:01 +00:00
parent 5f6d6a79e8
commit e349d92b53
4 changed files with 79 additions and 19 deletions

View File

@ -811,7 +811,11 @@ function customize_themes_print_templates() {
<p>
<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #>
<?php
_e( 'There is a new version available, but it doesn&#8217;t work with your versions of WordPress and PHP.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),
'{{{ data.name }}}'
);
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
@ -837,7 +841,11 @@ function customize_themes_print_templates() {
?>
<# } else if ( ! data.updateResponse.compatibleWP ) { #>
<?php
_e( 'There is a new version available, but it doesn&#8217;t work with your version of WordPress.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),
'{{{ data.name }}}'
);
if ( current_user_can( 'update_core' ) ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
@ -848,7 +856,11 @@ function customize_themes_print_templates() {
?>
<# } else if ( ! data.updateResponse.compatiblePHP ) { #>
<?php
_e( 'There is a new version available, but it doesn&#8217;t work with your version of PHP.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),
'{{{ data.name }}}'
);
if ( current_user_can( 'update_php' ) ) {
printf(
/* translators: %s: URL to Update PHP page. */

View File

@ -398,10 +398,14 @@ foreach ( $themes as $theme ) :
<?php endif; ?>
</p></div>
<?php else : ?>
<div class="notice inline notice-error notice-alt"><p>
<div class="update-message notice inline notice-error notice-alt"><p>
<?php
if ( ! $theme['updateResponse']['compatibleWP'] && ! $theme['updateResponse']['compatiblePHP'] ) {
_e( 'There is a new version available, but it doesn&#8217;t work with your versions of WordPress and PHP.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),
$theme['name']
);
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
@ -425,7 +429,11 @@ foreach ( $themes as $theme ) :
wp_update_php_annotation( '</p><p><em>', '</em>' );
}
} elseif ( ! $theme['updateResponse']['compatibleWP'] ) {
_e( 'There is a new version available, but it doesn&#8217;t work with your version of WordPress.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),
$theme['name']
);
if ( current_user_can( 'update_core' ) ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
@ -434,7 +442,11 @@ foreach ( $themes as $theme ) :
);
}
} elseif ( ! $theme['updateResponse']['compatiblePHP'] ) {
_e( 'There is a new version available, but it doesn&#8217;t work with your version of PHP.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),
$theme['name']
);
if ( current_user_can( 'update_php' ) ) {
printf(
/* translators: %s: URL to Update PHP page. */
@ -719,10 +731,14 @@ function wp_theme_auto_update_setting_template() {
<# } #>
</p></div>
<# } else { #>
<div class="notice inline notice-error notice-alt"><p>
<div class="update-message notice inline notice-error notice-alt"><p>
<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #>
<?php
_e( 'There is a new version available, but it doesn&#8217;t work with your versions of WordPress and PHP.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),
'{{{ data.name }}}'
);
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
@ -748,7 +764,11 @@ function wp_theme_auto_update_setting_template() {
?>
<# } else if ( ! data.updateResponse.compatibleWP ) { #>
<?php
_e( 'There is a new version available, but it doesn&#8217;t work with your version of WordPress.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),
'{{{ data.name }}}'
);
if ( current_user_can( 'update_core' ) ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
@ -759,7 +779,11 @@ function wp_theme_auto_update_setting_template() {
?>
<# } else if ( ! data.updateResponse.compatiblePHP ) { #>
<?php
_e( 'There is a new version available, but it doesn&#8217;t work with your version of PHP.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),
'{{{ data.name }}}'
);
if ( current_user_can( 'update_php' ) ) {
printf(
/* translators: %s: URL to Update PHP page. */
@ -973,7 +997,11 @@ function wp_theme_auto_update_setting_template() {
<p>
<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #>
<?php
_e( 'There is a new version available, but it doesn&#8217;t work with your versions of WordPress and PHP.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),
'{{{ data.name }}}'
);
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
@ -999,7 +1027,11 @@ function wp_theme_auto_update_setting_template() {
?>
<# } else if ( ! data.updateResponse.compatibleWP ) { #>
<?php
_e( 'There is a new version available, but it doesn&#8217;t work with your version of WordPress.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),
'{{{ data.name }}}'
);
if ( current_user_can( 'update_core' ) ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
@ -1010,7 +1042,11 @@ function wp_theme_auto_update_setting_template() {
?>
<# } else if ( ! data.updateResponse.compatiblePHP ) { #>
<?php
_e( 'There is a new version available, but it doesn&#8217;t work with your version of PHP.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),
'{{{ data.name }}}'
);
if ( current_user_can( 'update_php' ) ) {
printf(
/* translators: %s: URL to Update PHP page. */

View File

@ -107,11 +107,15 @@ class WP_Customize_Theme_Control extends WP_Customize_Control {
</p>
</div>
<# } else { #>
<div class="update-message notice inline notice-warning notice-alt" data-slug="{{ data.theme.id }}">
<div class="update-message notice inline notice-error notice-alt" data-slug="{{ data.theme.id }}">
<p>
<# if ( ! data.theme.updateResponse.compatibleWP && ! data.theme.updateResponse.compatiblePHP ) { #>
<?php
_e( 'There is a new version available, but it doesn&#8217;t work with your versions of WordPress and PHP.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),
'{{{ data.theme.name }}}'
);
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
@ -137,7 +141,11 @@ class WP_Customize_Theme_Control extends WP_Customize_Control {
?>
<# } else if ( ! data.theme.updateResponse.compatibleWP ) { #>
<?php
_e( 'There is a new version available, but it doesn&#8217;t work with your version of WordPress.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),
'{{{ data.theme.name }}}'
);
if ( current_user_can( 'update_core' ) ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
@ -148,7 +156,11 @@ class WP_Customize_Theme_Control extends WP_Customize_Control {
?>
<# } else if ( ! data.theme.updateResponse.compatiblePHP ) { #>
<?php
_e( 'There is a new version available, but it doesn&#8217;t work with your version of PHP.' );
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),
'{{{ data.theme.name }}}'
);
if ( current_user_can( 'update_php' ) ) {
printf(
/* translators: %s: URL to Update PHP page. */

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.5-beta4-48658';
$wp_version = '5.5-beta4-48659';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.