I18N: Use wp.i18n for translatable strings in wp-admin/js/tags.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 #50577.

git-svn-id: https://develop.svn.wordpress.org/trunk@48347 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling
2020-07-06 19:45:04 +00:00
parent 70cb267fde
commit 0d00b776ec
2 changed files with 4 additions and 11 deletions
+3 -3
View File
@@ -7,7 +7,7 @@
* @output wp-admin/js/tags.js
*/
/* global ajaxurl, wpAjax, tagsl10n, showNotice, validateForm */
/* global ajaxurl, wpAjax, showNotice, validateForm */
jQuery(document).ready(function($) {
@@ -55,11 +55,11 @@ jQuery(document).ready(function($) {
$('a.tag-link-' + data.match(/tag_ID=(\d+)/)[1]).remove();
} else if ( '-1' == r ) {
$('#ajax-response').empty().append('<div class="error"><p>' + tagsl10n.noPerm + '</p></div>');
$('#ajax-response').empty().append('<div class="error"><p>' + wp.i18n.__( 'Sorry, you are not allowed to do that.' ) + '</p></div>');
tr.children().css('backgroundColor', '');
} else {
$('#ajax-response').empty().append('<div class="error"><p>' + tagsl10n.broken + '</p></div>');
$('#ajax-response').empty().append('<div class="error"><p>' + wp.i18n.__( 'Something went wrong.' ) + '</p></div>');
tr.children().css('backgroundColor', '');
}
});