mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 04:34:31 +00:00
I18N: Use wp.i18n for translatable strings in wp-admin/js/user-profile.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities. Props swissspidy, ocean90. See #20491. Fixes #50527. git-svn-id: https://develop.svn.wordpress.org/trunk@48270 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user