Changeset 48396
- Timestamp:
- 07/07/2020 06:53:50 PM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/post.js
r48385 r48396 5 5 */ 6 6 7 /* global ajaxurl, wpAjax, setPostThumbnailL10n,postboxes, pagenow, tinymce, alert, deleteUserSetting, ClipboardJS */7 /* global ajaxurl, wpAjax, postboxes, pagenow, tinymce, alert, deleteUserSetting, ClipboardJS */ 8 8 /* global theList:true, theExtraList:true, getUserSetting, setUserSetting, commentReply, commentsBox */ 9 9 /* global WPSetThumbnailHTML, wptitlehint */ … … 146 146 function(str){ 147 147 if ( str == '0' ) { 148 alert( setPostThumbnailL10n.error);148 alert( __( 'Could not set that as the thumbnail image. Try a different attachment.' ) ); 149 149 } else { 150 150 WPSetThumbnailHTML(str); -
trunk/src/js/_enqueues/admin/set-post-thumbnail.js
r43577 r48396 3 3 */ 4 4 5 /* global setPostThumbnailL10n,ajaxurl, post_id, alert */5 /* global ajaxurl, post_id, alert */ 6 6 /* exported WPSetAsThumbnail */ 7 7 … … 9 9 var $link = jQuery('a#wp-post-thumbnail-' + id); 10 10 11 $link.text( setPostThumbnailL10n.saving);11 $link.text( wp.i18n.__( 'Saving…' ) ); 12 12 jQuery.post(ajaxurl, { 13 13 action: 'set-post-thumbnail', post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie ) 14 14 }, function(str){ 15 15 var win = window.dialogArguments || opener || parent || top; 16 $link.text( setPostThumbnailL10n.setThumbnail);16 $link.text( wp.i18n.__( 'Use as featured image' ) ); 17 17 if ( str == '0' ) { 18 alert( setPostThumbnailL10n.error);18 alert( wp.i18n.__( 'Could not set that as the thumbnail image. Try a different attachment.' ) ); 19 19 } else { 20 20 jQuery('a.wp-post-thumbnail').show(); 21 $link.text( setPostThumbnailL10n.done);21 $link.text( wp.i18n.__( 'Done' ) ); 22 22 $link.fadeOut( 2000 ); 23 23 win.WPSetThumbnailID(id); -
trunk/src/js/_enqueues/wp/media/editor.js
r47349 r48396 628 628 }).done( function( html ) { 629 629 if ( '0' === html ) { 630 window.alert( w indow.setPostThumbnailL10n.error);630 window.alert( wp.i18n.__( 'Could not set that as the thumbnail image. Try a different attachment.' ) ); 631 631 return; 632 632 } -
trunk/src/wp-includes/script-loader.php
r48395 r48396 1187 1187 1188 1188 $scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 ); 1189 $scripts->set_translations( 'media-editor' ); 1189 1190 $scripts->add( 'media-audiovideo', "/wp-includes/js/media-audiovideo$suffix.js", array( 'media-editor' ), false, 1 ); 1190 1191 $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'jquery', 'media-views', 'media-audiovideo' ), false, 1 ); … … 1288 1289 1289 1290 $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 ); 1290 did_action( 'init' ) && $scripts->localize( 1291 'set-post-thumbnail', 1292 'setPostThumbnailL10n', 1293 array( 1294 'setThumbnail' => __( 'Use as featured image' ), 1295 'saving' => __( 'Saving...' ), // No ellipsis. 1296 'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ), 1297 'done' => __( 'Done' ), 1298 ) 1299 ); 1291 $scripts->set_translations( 'set-post-thumbnail' ); 1300 1292 1301 1293 /*
Note: See TracChangeset
for help on using the changeset viewer.