Make WordPress Core


Ignore:
Timestamp:
07/01/2020 07:28:14 PM (5 years ago)
Author:
ocean90
Message:

I18N: Use wp.i18n for translatable strings in wp-includes/js/wp-pointer.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 #50525.

File:
1 edited

Legend:

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

    r48265 r48266  
    689689    );
    690690
    691     $scripts->add( 'wp-pointer', "/wp-includes/js/wp-pointer$suffix.js", array( 'jquery-ui-widget', 'jquery-ui-position' ), '20111129a', 1 );
    692     did_action( 'init' ) && $scripts->localize(
    693         'wp-pointer',
    694         'wpPointerL10n',
    695         array(
    696             'dismiss' => __( 'Dismiss' ),
    697         )
    698     );
     691    $scripts->add( 'wp-pointer', "/wp-includes/js/wp-pointer$suffix.js", array( 'jquery-ui-widget', 'jquery-ui-position' ), false, 1 );
     692    $scripts->set_translations( 'wp-pointer' );
    699693
    700694    $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array( 'heartbeat' ), false, 1 );
Note: See TracChangeset for help on using the changeset viewer.