diff --git a/src/wp-admin/js/updates.js b/src/wp-admin/js/updates.js index 028a852eae..1ae4486e69 100644 --- a/src/wp-admin/js/updates.js +++ b/src/wp-admin/js/updates.js @@ -371,11 +371,11 @@ if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) { $updateRow = $( 'tr[data-plugin="' + args.plugin + '"]' ); $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 ) { $card = $( '.plugin-card-' + args.slug ); $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. $card.removeClass( 'plugin-card-update-failed' ).find( '.notice.notice-error' ).remove(); @@ -429,8 +429,8 @@ } $updateMessage - .attr( 'aria-label', wp.updates.l10n.updatedLabel.replace( '%s', response.pluginName ) ) - .text( wp.updates.l10n.updated ); + .attr( 'aria-label', wp.updates.l10n.pluginUpdatedLabel.replace( '%s', response.pluginName ) ) + .text( wp.updates.l10n.pluginUpdated ); wp.a11y.speak( wp.updates.l10n.updatedMsg, 'polite' ); @@ -476,7 +476,7 @@ if ( response.pluginName ) { $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 { $message.find( 'p' ).removeAttr( 'aria-label' ); } @@ -493,7 +493,7 @@ if ( response.pluginName ) { $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 { $card.find( '.update-now' ).removeAttr( 'aria-label' ); } @@ -580,7 +580,7 @@ .removeClass( 'updating-message' ) .addClass( 'updated-message installed button-disabled' ) .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' ); @@ -965,7 +965,7 @@ $theme = $( '[data-slug="' + response.slug + '"]' ), updatedMessage = { className: 'updated-message notice-success notice-alt', - message: wp.updates.l10n.updated + message: wp.updates.l10n.themeUpdated }, $notice, newText; @@ -1102,7 +1102,7 @@ .removeClass( 'updating-message' ) .addClass( 'updated-message disabled' ) .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' ); @@ -1776,9 +1776,9 @@ if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) { 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 ) { - $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' ) ) ); } } } diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 81c1cb8f5b..4fa8047bf0 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -637,20 +637,21 @@ function wp_default_scripts( &$scripts ) { '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.' ), 'updating' => __( 'Updating...' ), // No ellipsis. - 'updated' => __( 'Updated!' ), + 'pluginUpdated' => _x( 'Updated!', 'plugin' ), + 'themeUpdated' => _x( 'Updated!', 'theme' ), 'update' => __( 'Update' ), 'updateNow' => __( 'Update Now' ), /* translators: %s: Plugin name and version */ - 'updateNowLabel' => __( 'Update %s now' ), + 'pluginUpdateNowLabel' => _x( 'Update %s now', 'plugin' ), 'updateFailedShort' => __( 'Update Failed!' ), /* translators: %s: Error string for a failed update */ 'updateFailed' => __( 'Update Failed: %s' ), /* translators: %s: Plugin name and version */ - 'updatingLabel' => __( 'Updating %s...' ), // No ellipsis. + 'pluginUpdatingLabel' => _x( 'Updating %s...', 'plugin' ), // No ellipsis. /* translators: %s: Plugin name and version */ - 'updatedLabel' => __( '%s updated!' ), + 'pluginUpdatedLabel' => _x( '%s updated!', 'plugin' ), /* translators: %s: Plugin name and version */ - 'updateFailedLabel' => __( '%s update failed' ), + 'pluginUpdateFailedLabel' => _x( '%s update failed', 'plugin' ), /* translators: Accessibility text */ 'updatingMsg' => __( 'Updating... please wait.' ), // No ellipsis. /* translators: Accessibility text */ @@ -660,9 +661,10 @@ function wp_default_scripts( &$scripts ) { 'beforeunload' => __( 'Updates may not complete if you navigate away from this page.' ), 'installNow' => __( 'Install Now' ), /* translators: %s: Plugin name */ - 'installNowLabel' => __( 'Install %s now' ), + 'pluginInstallNowLabel' => _x( 'Install %s now', 'plugin' ), 'installing' => __( 'Installing...' ), - 'installed' => __( 'Installed!' ), + 'pluginInstalled' => _x( 'Installed!', 'plugin' ), + 'themeInstalled' => _x( 'Installed!', 'theme' ), 'installFailedShort' => __( 'Install Failed!' ), /* translators: %s: Error string for a failed installation */ 'installFailed' => __( 'Installation failed: %s' ), diff --git a/tests/qunit/fixtures/updates.js b/tests/qunit/fixtures/updates.js index 1d318d89b6..9e137c4e72 100644 --- a/tests/qunit/fixtures/updates.js +++ b/tests/qunit/fixtures/updates.js @@ -6,23 +6,25 @@ window._wpUpdatesSettings = { '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.', 'updating': 'Updating...', - 'updated': 'Updated!', + 'pluginUpdated': 'Updated!', + 'themeUpdated': 'Updated!', 'update': 'Update', 'updateNow': 'Update Now', - 'updateNowLabel': 'Update %s now', + 'pluginUpdateNowLabel': 'Update %s now', 'updateFailedShort': 'Update Failed!', 'updateFailed': 'Update Failed: %s', - 'updatingLabel': 'Updating %s...', - 'updatedLabel': '%s updated!', - 'updateFailedLabel': '%s update failed', + 'pluginUpdatingLabel': 'Updating %s...', + 'pluginUpdatedLabel': '%s updated!', + 'pluginUpdateFailedLabel': '%s update failed', 'updatingMsg': 'Updating... please wait.', 'updatedMsg': 'Update completed successfully.', 'updateCancel': 'Update canceled.', 'beforeunload': 'Updates may not complete if you navigate away from this page.', 'installNow': 'Install Now', - 'installNowLabel': 'Install %s now', + 'pluginInstallNowLabel': 'Install %s now', 'installing': 'Installing...', - 'installed': 'Installed!', + 'pluginInstalled': 'Installed!', + 'themeInstalled': 'Installed!', 'installFailedShort': 'Install Failed!', 'installFailed': 'Installation failed: %s', 'pluginInstallingLabel': 'Installing %s...', // No ellipsis