From baa9fc7cd05c928baf98ed175597febba29fe557 Mon Sep 17 00:00:00 2001 From: Mike Szczys Date: Thu, 13 Aug 2020 14:05:22 -0500 Subject: [PATCH] Moved all setPostThumbnailL10n string calls to wp.i18n calls to match what's found in WordPress 5.5. core updates: https://github.com/WordPress/WordPress/commit/4377e9a44e2c10ac66cb9cc49a4a3c8dff6a433f#diff-4bfa11da57ff2600004bb500368247f4 --- js/multi-post-thumbnails-admin.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/multi-post-thumbnails-admin.js b/js/multi-post-thumbnails-admin.js index 8797dcc..a49230c 100644 --- a/js/multi-post-thumbnails-admin.js +++ b/js/multi-post-thumbnails-admin.js @@ -16,7 +16,7 @@ window.MultiPostThumbnails = { action:'set-' + post_type + '-' + id + '-thumbnail', post_id: jQuery('#post_ID').val(), thumbnail_id: -1, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie) }, function(str){ if ( str == '0' ) { - alert( setPostThumbnailL10n.error ); + alert( wp.i18n.__( 'Could not set that as the thumbnail image. Try a different attachment.' ) ); } else { MultiPostThumbnails.setThumbnailHTML(str, id, post_type); } @@ -28,17 +28,17 @@ window.MultiPostThumbnails = { setAsThumbnail: function(thumb_id, id, post_type, nonce){ var $link = jQuery('a#' + post_type + '-' + id + '-thumbnail-' + thumb_id); $link.data('thumbnail_id', thumb_id); - $link.text( setPostThumbnailL10n.saving ); + $link.text( wp.i18n.__( 'Saving…' ) ); jQuery.post(ajaxurl, { action:'set-' + post_type + '-' + id + '-thumbnail', post_id: post_id, thumbnail_id: thumb_id, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie) }, function(str){ var win = window.dialogArguments || opener || parent || top; - $link.text( setPostThumbnailL10n.setThumbnail ); + $link.text( wp.i18n.__( 'Use as featured image' ) ); if ( str == '0' ) { - alert( setPostThumbnailL10n.error ); + alert( wp.i18n.__( 'Could not set that as the thumbnail image. Try a different attachment.' ) ); } else { $link.show(); - $link.text( setPostThumbnailL10n.done ); + $link.text( wp.i18n.__( 'Done' ) ); $link.fadeOut( 2000, function() { jQuery('tr.' + post_type + '-' + id + '-thumbnail').hide(); }); @@ -48,4 +48,4 @@ window.MultiPostThumbnails = { } ); } -} \ No newline at end of file +}