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/tags-box.js and wp-admin/js/tags-suggest.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 #50579. git-svn-id: https://develop.svn.wordpress.org/trunk@48350 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1212,19 +1212,10 @@ function wp_default_scripts( $scripts ) {
|
||||
$scripts->set_translations( 'postbox' );
|
||||
|
||||
$scripts->add( 'tags-box', "/wp-admin/js/tags-box$suffix.js", array( 'jquery', 'tags-suggest' ), false, 1 );
|
||||
$scripts->set_translations( 'tags-box' );
|
||||
|
||||
$scripts->add( 'tags-suggest', "/wp-admin/js/tags-suggest$suffix.js", array( 'jquery-ui-autocomplete', 'wp-a11y' ), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize(
|
||||
'tags-suggest',
|
||||
'tagsSuggestL10n',
|
||||
array(
|
||||
'tagDelimiter' => _x( ',', 'tag delimiter' ),
|
||||
'removeTerm' => __( 'Remove term:' ),
|
||||
'termSelected' => __( 'Term selected.' ),
|
||||
'termAdded' => __( 'Term added.' ),
|
||||
'termRemoved' => __( 'Term removed.' ),
|
||||
)
|
||||
);
|
||||
$scripts->set_translations( 'tags-suggest' );
|
||||
|
||||
$scripts->add( 'post', "/wp-admin/js/post$suffix.js", array( 'suggest', 'wp-lists', 'postbox', 'tags-box', 'underscore', 'word-count', 'wp-a11y', 'wp-sanitize', 'clipboard' ), false, 1 );
|
||||
$scripts->set_translations( 'post' );
|
||||
|
||||
Reference in New Issue
Block a user