I18N: Use wp.i18n
for translatable strings in wp-includes/js/wp-auth-check.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 #50553. git-svn-id: https://develop.svn.wordpress.org/trunk@48285 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a0891d732e
commit
5b270df345
@ -23,7 +23,7 @@
|
||||
if ( form.length ) {
|
||||
// Add unload confirmation to counter (frame-busting) JS redirects.
|
||||
$(window).on( 'beforeunload.wp-auth-check', function(e) {
|
||||
e.originalEvent.returnValue = window.authcheckL10n.beforeunload;
|
||||
e.originalEvent.returnValue = wp.i18n.__( 'Your session has expired. You can log in again from this page or go to the login page.' );
|
||||
});
|
||||
|
||||
frame = $('<iframe id="wp-auth-check-frame" frameborder="0">').attr( 'title', noframe.text() );
|
||||
|
@ -699,13 +699,7 @@ function wp_default_scripts( $scripts ) {
|
||||
);
|
||||
|
||||
$scripts->add( 'wp-auth-check', "/wp-includes/js/wp-auth-check$suffix.js", array( 'heartbeat' ), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize(
|
||||
'wp-auth-check',
|
||||
'authcheckL10n',
|
||||
array(
|
||||
'beforeunload' => __( 'Your session has expired. You can log in again from this page or go to the login page.' ),
|
||||
)
|
||||
);
|
||||
$scripts->set_translations( 'wp-auth-check' );
|
||||
|
||||
$scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array( 'wp-ajax-response', 'jquery-color' ), false, 1 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user