Update/Install: Give context to some more install/update strings to allow for differentiation between theme and plugin translations.

Fixes #39747. See #37290.
Built from https://develop.svn.wordpress.org/trunk@40034


git-svn-id: http://core.svn.wordpress.org/trunk@39971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2017-01-31 09:27:41 +00:00
parent a6215fd8ac
commit 9264813949
4 changed files with 22 additions and 20 deletions

View File

@ -371,11 +371,11 @@
if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) { if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
$updateRow = $( 'tr[data-plugin="' + args.plugin + '"]' ); $updateRow = $( 'tr[data-plugin="' + args.plugin + '"]' );
$message = $updateRow.find( '.update-message' ).removeClass( 'notice-error' ).addClass( 'updating-message notice-warning' ).find( 'p' ); $message = $updateRow.find( '.update-message' ).removeClass( 'notice-error' ).addClass( 'updating-message notice-warning' ).find( 'p' );
message = wp.updates.l10n.updatingLabel.replace( '%s', $updateRow.find( '.plugin-title strong' ).text() ); message = wp.updates.l10n.pluginUpdatingLabel.replace( '%s', $updateRow.find( '.plugin-title strong' ).text() );
} else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) { } else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
$card = $( '.plugin-card-' + args.slug ); $card = $( '.plugin-card-' + args.slug );
$message = $card.find( '.update-now' ).addClass( 'updating-message' ); $message = $card.find( '.update-now' ).addClass( 'updating-message' );
message = wp.updates.l10n.updatingLabel.replace( '%s', $message.data( 'name' ) ); message = wp.updates.l10n.pluginUpdatingLabel.replace( '%s', $message.data( 'name' ) );
// Remove previous error messages, if any. // Remove previous error messages, if any.
$card.removeClass( 'plugin-card-update-failed' ).find( '.notice.notice-error' ).remove(); $card.removeClass( 'plugin-card-update-failed' ).find( '.notice.notice-error' ).remove();
@ -429,8 +429,8 @@
} }
$updateMessage $updateMessage
.attr( 'aria-label', wp.updates.l10n.updatedLabel.replace( '%s', response.pluginName ) ) .attr( 'aria-label', wp.updates.l10n.pluginUpdatedLabel.replace( '%s', response.pluginName ) )
.text( wp.updates.l10n.updated ); .text( wp.updates.l10n.pluginUpdated );
wp.a11y.speak( wp.updates.l10n.updatedMsg, 'polite' ); wp.a11y.speak( wp.updates.l10n.updatedMsg, 'polite' );
@ -476,7 +476,7 @@
if ( response.pluginName ) { if ( response.pluginName ) {
$message.find( 'p' ) $message.find( 'p' )
.attr( 'aria-label', wp.updates.l10n.updateFailedLabel.replace( '%s', response.pluginName ) ); .attr( 'aria-label', wp.updates.l10n.pluginUpdateFailedLabel.replace( '%s', response.pluginName ) );
} else { } else {
$message.find( 'p' ).removeAttr( 'aria-label' ); $message.find( 'p' ).removeAttr( 'aria-label' );
} }
@ -493,7 +493,7 @@
if ( response.pluginName ) { if ( response.pluginName ) {
$card.find( '.update-now' ) $card.find( '.update-now' )
.attr( 'aria-label', wp.updates.l10n.updateFailedLabel.replace( '%s', response.pluginName ) ); .attr( 'aria-label', wp.updates.l10n.pluginUpdateFailedLabel.replace( '%s', response.pluginName ) );
} else { } else {
$card.find( '.update-now' ).removeAttr( 'aria-label' ); $card.find( '.update-now' ).removeAttr( 'aria-label' );
} }
@ -580,7 +580,7 @@
.removeClass( 'updating-message' ) .removeClass( 'updating-message' )
.addClass( 'updated-message installed button-disabled' ) .addClass( 'updated-message installed button-disabled' )
.attr( 'aria-label', wp.updates.l10n.pluginInstalledLabel.replace( '%s', response.pluginName ) ) .attr( 'aria-label', wp.updates.l10n.pluginInstalledLabel.replace( '%s', response.pluginName ) )
.text( wp.updates.l10n.installed ); .text( wp.updates.l10n.pluginInstalled );
wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' ); wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' );
@ -965,7 +965,7 @@
$theme = $( '[data-slug="' + response.slug + '"]' ), $theme = $( '[data-slug="' + response.slug + '"]' ),
updatedMessage = { updatedMessage = {
className: 'updated-message notice-success notice-alt', className: 'updated-message notice-success notice-alt',
message: wp.updates.l10n.updated message: wp.updates.l10n.themeUpdated
}, },
$notice, newText; $notice, newText;
@ -1102,7 +1102,7 @@
.removeClass( 'updating-message' ) .removeClass( 'updating-message' )
.addClass( 'updated-message disabled' ) .addClass( 'updated-message disabled' )
.attr( 'aria-label', wp.updates.l10n.themeInstalledLabel.replace( '%s', response.themeName ) ) .attr( 'aria-label', wp.updates.l10n.themeInstalledLabel.replace( '%s', response.themeName ) )
.text( wp.updates.l10n.installed ); .text( wp.updates.l10n.themeInstalled );
wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' ); wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' );
@ -1776,9 +1776,9 @@
if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) { if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
if ( 'update-plugin' === job.action ) { if ( 'update-plugin' === job.action ) {
$message.attr( 'aria-label', wp.updates.l10n.updateNowLabel.replace( '%s', $message.data( 'name' ) ) ); $message.attr( 'aria-label', wp.updates.l10n.pluginUpdateNowLabel.replace( '%s', $message.data( 'name' ) ) );
} else if ( 'install-plugin' === job.action ) { } else if ( 'install-plugin' === job.action ) {
$message.attr( 'aria-label', wp.updates.l10n.installNowLabel.replace( '%s', $message.data( 'name' ) ) ); $message.attr( 'aria-label', wp.updates.l10n.pluginInstallNowLabel.replace( '%s', $message.data( 'name' ) ) );
} }
} }
} }

File diff suppressed because one or more lines are too long

View File

@ -637,20 +637,21 @@ function wp_default_scripts( &$scripts ) {
'noPlugins' => __( 'You do not appear to have any plugins available at this time.' ), 'noPlugins' => __( 'You do not appear to have any plugins available at this time.' ),
'noItemsSelected' => __( 'Please select at least one item to perform this action on.' ), 'noItemsSelected' => __( 'Please select at least one item to perform this action on.' ),
'updating' => __( 'Updating...' ), // No ellipsis. 'updating' => __( 'Updating...' ), // No ellipsis.
'updated' => __( 'Updated!' ), 'pluginUpdated' => _x( 'Updated!', 'plugin' ),
'themeUpdated' => _x( 'Updated!', 'theme' ),
'update' => __( 'Update' ), 'update' => __( 'Update' ),
'updateNow' => __( 'Update Now' ), 'updateNow' => __( 'Update Now' ),
/* translators: %s: Plugin name and version */ /* translators: %s: Plugin name and version */
'updateNowLabel' => __( 'Update %s now' ), 'pluginUpdateNowLabel' => _x( 'Update %s now', 'plugin' ),
'updateFailedShort' => __( 'Update Failed!' ), 'updateFailedShort' => __( 'Update Failed!' ),
/* translators: %s: Error string for a failed update */ /* translators: %s: Error string for a failed update */
'updateFailed' => __( 'Update Failed: %s' ), 'updateFailed' => __( 'Update Failed: %s' ),
/* translators: %s: Plugin name and version */ /* translators: %s: Plugin name and version */
'updatingLabel' => __( 'Updating %s...' ), // No ellipsis. 'pluginUpdatingLabel' => _x( 'Updating %s...', 'plugin' ), // No ellipsis.
/* translators: %s: Plugin name and version */ /* translators: %s: Plugin name and version */
'updatedLabel' => __( '%s updated!' ), 'pluginUpdatedLabel' => _x( '%s updated!', 'plugin' ),
/* translators: %s: Plugin name and version */ /* translators: %s: Plugin name and version */
'updateFailedLabel' => __( '%s update failed' ), 'pluginUpdateFailedLabel' => _x( '%s update failed', 'plugin' ),
/* translators: Accessibility text */ /* translators: Accessibility text */
'updatingMsg' => __( 'Updating... please wait.' ), // No ellipsis. 'updatingMsg' => __( 'Updating... please wait.' ), // No ellipsis.
/* translators: Accessibility text */ /* translators: Accessibility text */
@ -660,9 +661,10 @@ function wp_default_scripts( &$scripts ) {
'beforeunload' => __( 'Updates may not complete if you navigate away from this page.' ), 'beforeunload' => __( 'Updates may not complete if you navigate away from this page.' ),
'installNow' => __( 'Install Now' ), 'installNow' => __( 'Install Now' ),
/* translators: %s: Plugin name */ /* translators: %s: Plugin name */
'installNowLabel' => __( 'Install %s now' ), 'pluginInstallNowLabel' => _x( 'Install %s now', 'plugin' ),
'installing' => __( 'Installing...' ), 'installing' => __( 'Installing...' ),
'installed' => __( 'Installed!' ), 'pluginInstalled' => _x( 'Installed!', 'plugin' ),
'themeInstalled' => _x( 'Installed!', 'theme' ),
'installFailedShort' => __( 'Install Failed!' ), 'installFailedShort' => __( 'Install Failed!' ),
/* translators: %s: Error string for a failed installation */ /* translators: %s: Error string for a failed installation */
'installFailed' => __( 'Installation failed: %s' ), 'installFailed' => __( 'Installation failed: %s' ),

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.8-alpha-40033'; $wp_version = '4.8-alpha-40034';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.