From 5b270df3453c986f51a5878715c6dd7352299a89 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Fri, 3 Jul 2020 19:03:23 +0000 Subject: [PATCH] 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 --- src/js/_enqueues/lib/auth-check.js | 2 +- src/wp-includes/script-loader.php | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/js/_enqueues/lib/auth-check.js b/src/js/_enqueues/lib/auth-check.js index a31f3cce10..be2a37cfc0 100644 --- a/src/js/_enqueues/lib/auth-check.js +++ b/src/js/_enqueues/lib/auth-check.js @@ -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 = $('