Make WordPress Core


Ignore:
Timestamp:
07/03/2020 07:03:23 PM (4 years ago)
Author:
ocean90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r48276 r48285  
    700700
    701701    $scripts->add( 'wp-auth-check', "/wp-includes/js/wp-auth-check$suffix.js", array( 'heartbeat' ), false, 1 );
    702     did_action( 'init' ) && $scripts->localize(
    703         'wp-auth-check',
    704         'authcheckL10n',
    705         array(
    706             'beforeunload' => __( 'Your session has expired. You can log in again from this page or go to the login page.' ),
    707         )
    708     );
     702    $scripts->set_translations( 'wp-auth-check' );
    709703
    710704    $scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array( 'wp-ajax-response', 'jquery-color' ), false, 1 );
Note: See TracChangeset for help on using the changeset viewer.