diff --git a/src/js/_enqueues/admin/user-profile.js b/src/js/_enqueues/admin/user-profile.js index a45164578f..b73f2ab5c4 100644 --- a/src/js/_enqueues/admin/user-profile.js +++ b/src/js/_enqueues/admin/user-profile.js @@ -2,10 +2,10 @@ * @output wp-admin/js/user-profile.js */ -/* global ajaxurl, pwsL10n, userProfileL10n */ +/* global ajaxurl, pwsL10n */ (function($) { var updateLock = false, - + __ = wp.i18n.__, $pass1Row, $pass1, $pass2, @@ -39,7 +39,7 @@ } // Once zxcvbn loads, passwords strength is known. - $( '#pw-weak-text-label' ).html( userProfileL10n.warnWeak ); + $( '#pw-weak-text-label' ).text( __( 'Confirm use of weak password' ) ); } function bindPass1() { @@ -64,10 +64,10 @@ function resetToggle( show ) { $toggleButton .attr({ - 'aria-label': show ? userProfileL10n.ariaShow : userProfileL10n.ariaHide + 'aria-label': show ? __( 'Show password' ) : __( 'Hide password' ) }) .find( '.text' ) - .text( show ? userProfileL10n.show : userProfileL10n.hide ) + .text( show ? __( 'Show' ) : __( 'Hide' ) ) .end() .find( '.dashicons' ) .removeClass( show ? 'dashicons-hidden' : 'dashicons-visibility' ) @@ -402,7 +402,7 @@ /* Warn the user if password was generated but not saved */ $( window ).on( 'beforeunload', function () { if ( true === updateLock ) { - return userProfileL10n.warn; + return __( 'Your new password has not been saved.' ); } } ); diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index b7e2f6bfa3..f016a1728d 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -1065,19 +1065,7 @@ function wp_default_scripts( $scripts ) { $scripts->set_translations( 'password-strength-meter' ); $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter', 'wp-util' ), false, 1 ); - did_action( 'init' ) && $scripts->localize( - 'user-profile', - 'userProfileL10n', - array( - 'warn' => __( 'Your new password has not been saved.' ), - 'warnWeak' => __( 'Confirm use of weak password' ), - 'show' => __( 'Show' ), - 'hide' => __( 'Hide' ), - 'cancel' => __( 'Cancel' ), - 'ariaShow' => esc_attr__( 'Show password' ), - 'ariaHide' => esc_attr__( 'Hide password' ), - ) - ); + $scripts->set_translations( 'user-profile' ); $scripts->add( 'language-chooser', "/wp-admin/js/language-chooser$suffix.js", array( 'jquery' ), false, 1 );