Ticket #20491: 20491-applied.diff
File 20491-applied.diff, 199.8 KB (added by , 8 years ago) |
---|
-
src/wp-admin/js/color-picker.js
diff --git src/wp-admin/js/color-picker.js src/wp-admin/js/color-picker.js index 96f55da..6c423fc 100644
38 38 // Set up HTML structure, hide things 39 39 el.addClass( 'wp-color-picker' ).hide().wrap( _wrap ); 40 40 self.wrap = el.parent(); 41 self.toggler = $( _before ).insertBefore( el ).css( { backgroundColor: self.initialValue } ).attr( 'title', wp ColorPickerL10n.pick ).attr( 'data-current', wpColorPickerL10n.current);41 self.toggler = $( _before ).insertBefore( el ).css( { backgroundColor: self.initialValue } ).attr( 'title', wp.i18n.__( 'Select Color' ) ).attr( 'data-current', wp.i18n.__( 'Current Color' ) ); 42 42 self.pickerContainer = $( _after ).insertAfter( el ); 43 43 self.button = $( _button ); 44 44 45 45 if ( self.options.defaultColor ) { 46 self.button.addClass( 'wp-picker-default' ).val( wp ColorPickerL10n.defaultString);46 self.button.addClass( 'wp-picker-default' ).val( wp.i18n.__( 'Default' ) ); 47 47 } else { 48 self.button.addClass( 'wp-picker-clear' ).val( wp ColorPickerL10n.clear);48 self.button.addClass( 'wp-picker-clear' ).val( wp.i18n.__( 'Clear' ) ); 49 49 } 50 50 51 51 el.wrap( '<span class="wp-picker-input-wrap" />' ).after(self.button); -
src/wp-admin/js/comment.js
diff --git src/wp-admin/js/comment.js src/wp-admin/js/comment.js index d194148..29ea8f7 100644
jQuery(document).ready( function($) { 46 46 } 47 47 48 48 $timestamp.html( 49 commentL10n.submittedOn + ' <b>' + 50 commentL10n.dateFormat 49 wp.i18n.__( 'Submitted on:' ) + ' <b>' + 50 /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */ 51 __( '%1$s %2$s, %3$s @ %4$s:%5$s' ) 51 52 .replace( '%1$s', $( 'option[value="' + mm + '"]', '#mm' ).attr( 'data-text' ) ) 52 53 .replace( '%2$s', parseInt( jj, 10 ) ) 53 54 .replace( '%3$s', aa ) -
src/wp-admin/js/common.js
diff --git src/wp-admin/js/common.js src/wp-admin/js/common.js index 200d3e4..dd3e463 100644
1 /* global setUserSetting, ajaxurl, commonL10n,alert, confirm, pagenow */1 /* global setUserSetting, ajaxurl, alert, confirm, pagenow */ 2 2 var showNotice, adminMenu, columns, validateForm, screenMeta; 3 3 ( function( $, window, undefined ) { 4 4 var $document = $( document ), … … validateForm = function( form ) { 89 89 // stub for doing better warnings 90 90 showNotice = { 91 91 warn : function() { 92 var msg = commonL10n.warnDelete || ''; 92 var msg = wp.i18n.__( "You are about to permanently delete these items.\n 'Cancel' to stop, 'OK' to delete." ); 93 93 94 if ( confirm(msg) ) { 94 95 return true; 95 96 } … … $document.ready( function() { 404 405 $( '.notice.is-dismissible' ).each( function() { 405 406 var $el = $( this ), 406 407 $button = $( '<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>' ), 407 btnText = commonL10n.dismiss || '';408 btnText = wp.i18n.__( 'Dismiss this notice.' ); 408 409 409 410 // Ensure plain text 410 411 $button.find( '.screen-reader-text' ).text( btnText ); -
src/wp-admin/js/customize-controls.js
diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js index 7078cfd..4543d28 100644
1 /* global _wpCustomizeHeader, _wpCustomizeBackground, _wpMediaViewsL10n,MediaElementPlayer */1 /* global _wpCustomizeHeader, _wpCustomizeBackground, MediaElementPlayer */ 2 2 (function( exports, $ ){ 3 3 var Container, focus, api = wp.customize; 4 4 … … 2201 2201 * Create a media modal select frame, and store it so the instance can be reused when needed. 2202 2202 */ 2203 2203 initFrame: function() { 2204 var l10n = _wpMediaViewsL10n;2205 2206 2204 this.frame = wp.media({ 2207 2205 button: { 2208 text: l10n.select,2206 text: wp.i18n.__( 'Select' ), 2209 2207 close: false 2210 2208 }, 2211 2209 states: [ … … 2392 2390 * Create a media modal select frame, and store it so the instance can be reused when needed. 2393 2391 */ 2394 2392 initFrame: function() { 2395 var l10n = _wpMediaViewsL10n;2396 2397 2393 this.frame = wp.media({ 2398 2394 button: { 2399 text: l10n.select,2395 text: wp.i18n.__( 'Select' ), 2400 2396 close: false 2401 2397 }, 2402 2398 states: [ … … 2648 2644 * @param {event} event 2649 2645 */ 2650 2646 openMedia: function(event) { 2651 var l10n = _wpMediaViewsL10n;2652 2653 2647 event.preventDefault(); 2654 2648 2655 2649 this.frame = wp.media({ 2656 2650 button: { 2657 text: l10n.selectAndCrop,2651 text: wp.i18n.__( 'Select and Crop' ), 2658 2652 close: false 2659 2653 }, 2660 2654 states: [ 2661 2655 new wp.media.controller.Library({ 2662 title: l10n.chooseImage,2656 title: wp.i18n.__( 'Choose Image' ), 2663 2657 library: wp.media.query({ type: 'image' }), 2664 2658 multiple: false, 2665 2659 date: false, … … 3046 3040 response = response.slice( 0, index ) + response.slice( index + signature.length ); 3047 3041 3048 3042 // Create the iframe and inject the html content. 3049 self.iframe = $( '<iframe />', { 'title': api.l10n.previewIframeTitle} ).appendTo( self.container );3043 self.iframe = $( '<iframe />', { 'title': wp.i18n.__( 'Site Preview' ) } ).appendTo( self.container ); 3050 3044 3051 3045 // Bind load event after the iframe has been added to the page; 3052 3046 // otherwise it will fire when injected into the DOM. … … 3092 3086 reject(); 3093 3087 } 3094 3088 3095 iframe = $( '<iframe />', { 'src': self.previewUrl(), 'title': api.l10n.previewIframeTitle} ).hide();3089 iframe = $( '<iframe />', { 'src': self.previewUrl(), 'title': wp.i18n.__( 'Site Preview' ) } ).hide(); 3096 3090 iframe.appendTo( self.container ); 3097 3091 iframe.on( 'load', function() { 3098 3092 self.triedLogin = true; … … 3364 3358 url: api.settings.url.login 3365 3359 }); 3366 3360 3367 iframe = $( '<iframe />', { 'src': api.settings.url.login, 'title': api.l10n.loginIframeTitle} ).appendTo( this.container );3361 iframe = $( '<iframe />', { 'src': api.settings.url.login, 'title': wp.i18n.__( 'Session expired' ) } ).appendTo( this.container ); 3368 3362 3369 3363 messenger.targetWindow( iframe[0].contentWindow ); 3370 3364 … … 3392 3386 3393 3387 cheatin: function() { 3394 3388 $( document.body ).empty().addClass( 'cheatin' ).append( 3395 '<h1>' + api.l10n.cheatin+ '</h1>' +3396 '<p>' + api.l10n.notAllowed+ '</p>'3389 '<h1>' + wp.i18n.__( 'Cheatin’ uh?' ) + '</h1>' + 3390 '<p>' + wp.i18n.__( 'Sorry, you are not allowed to customize this site.' ) + '</p>' 3397 3391 ); 3398 3392 }, 3399 3393 … … 3608 3602 3609 3603 $( function() { 3610 3604 api.settings = window._wpCustomizeSettings; 3611 api.l10n = window._wpCustomizeControlsL10n;3612 3605 3613 3606 // Check if we can run the Customizer. 3614 3607 if ( ! api.settings ) { … … 3921 3914 3922 3915 state.bind( 'change', function() { 3923 3916 if ( ! activated() ) { 3924 saveBtn.val( api.l10n.activate).prop( 'disabled', false );3925 closeBtn.find( '.screen-reader-text' ).text( api.l10n.cancel);3917 saveBtn.val( wp.i18n.__( 'Save & Activate' ) ).prop( 'disabled', false ); 3918 closeBtn.find( '.screen-reader-text' ).text( wp.i18n.__( 'Cancel' ) ); 3926 3919 3927 3920 } else if ( saved() ) { 3928 saveBtn.val( api.l10n.saved).prop( 'disabled', true );3929 closeBtn.find( '.screen-reader-text' ).text( api.l10n.close);3921 saveBtn.val( wp.i18n.__( 'Saved' ) ).prop( 'disabled', true ); 3922 closeBtn.find( '.screen-reader-text' ).text( wp.i18n.__( 'Close' ) ); 3930 3923 3931 3924 } else { 3932 saveBtn.val( api.l10n.save).prop( 'disabled', false );3933 closeBtn.find( '.screen-reader-text' ).text( api.l10n.cancel);3925 saveBtn.val( wp.i18n.__( 'Save & Publish' ) ).prop( 'disabled', false ); 3926 closeBtn.find( '.screen-reader-text' ).text( wp.i18n.__( 'Cancel' ) ); 3934 3927 } 3935 3928 }); 3936 3929 … … 3988 3981 overlay.toggleClass( 'collapsed', ! paneVisible ); 3989 3982 3990 3983 if ( ! paneVisible ) { 3991 $( '.collapse-sidebar' ).attr({ 'aria-expanded': 'false', 'aria-label': api.l10n.expandSidebar});3984 $( '.collapse-sidebar' ).attr({ 'aria-expanded': 'false', 'aria-label': wp.i18n.__( 'Expand Sidebar' ) }); 3992 3985 } else { 3993 $( '.collapse-sidebar' ).attr({ 'aria-expanded': 'true', 'aria-label': api.l10n.collapseSidebar});3986 $( '.collapse-sidebar' ).attr({ 'aria-expanded': 'true', 'aria-label': wp.i18n.__( 'Expand Sidebar' ) }); 3994 3987 } 3995 3988 }); 3996 3989 … … 4080 4073 if ( title.length ) { 4081 4074 api( 'blogname', function( setting ) { 4082 4075 var updateTitle = function() { 4083 title.text( $.trim( setting() ) || api.l10n.untitledBlogName);4076 title.text( $.trim( setting() ) || wp.i18n.__( '(Untitled)' ) ); 4084 4077 }; 4085 4078 setting.bind( updateTitle ); 4086 4079 updateTitle(); … … 4115 4108 setTimeout( function() { 4116 4109 overlay.removeClass( 'customize-loading' ); 4117 4110 }, 1 ); 4118 return api.l10n.saveAlert;4111 return wp.i18n.__( 'The changes you made will be lost if you navigate away from this page.' ); 4119 4112 } 4120 4113 } ); 4121 4114 -
src/wp-admin/js/customize-widgets.js
diff --git src/wp-admin/js/customize-widgets.js src/wp-admin/js/customize-widgets.js index 7598023..6d550ca 100644
756 756 757 757 if ( isMoveUp ) { 758 758 self.moveUp(); 759 wp.a11y.speak( l10n.widgetMovedUp);759 wp.a11y.speak( wp.i18n.__( 'Widget moved up' ) ); 760 760 } else { 761 761 self.moveDown(); 762 wp.a11y.speak( l10n.widgetMovedDown);762 wp.a11y.speak( wp.i18n.__( 'Widget moved down' ) ); 763 763 } 764 764 765 765 $( this ).focus(); // re-focus after the container was moved … … 833 833 834 834 // Configure update button 835 835 $saveBtn = this.container.find( '.widget-control-save' ); 836 $saveBtn.val( l10n.saveBtnLabel);837 $saveBtn.attr( 'title', l10n.saveBtnTooltip);836 $saveBtn.val( wp.i18n.__( 'Apply' ) ); 837 $saveBtn.attr( 'title', wp.i18n.__( 'Save and preview changes before publishing them.' ) ); 838 838 $saveBtn.removeClass( 'button-primary' ).addClass( 'button-secondary' ); 839 839 $saveBtn.on( 'click', function( e ) { 840 840 e.preventDefault(); … … 946 946 } ); 947 947 948 948 replaceDeleteWithRemove = function() { 949 $removeBtn.text( l10n.removeBtnLabel); // wp_widget_control() outputs the link as "Delete"950 $removeBtn.attr( 'title', l10n.removeBtnTooltip);949 $removeBtn.text( wp.i18n.__( 'Remove' ) ); // wp_widget_control() outputs the link as "Delete" 950 $removeBtn.attr( 'title', wp.i18n.__( 'Trash widget by moving it to the inactive widgets sidebar.' ) ); 951 951 }; 952 952 953 953 if ( this.params.is_new ) { … … 1223 1223 } 1224 1224 } else { 1225 1225 // General error message 1226 message = l10n.error;1226 message = wp.i18n.__( 'An error has occurred. Please reload the page and try again.' ); 1227 1227 1228 1228 if ( r.data && r.data.message ) { 1229 1229 message = r.data.message; … … 1534 1534 'class': 'no-widget-areas-rendered-notice' 1535 1535 }); 1536 1536 noRenderedAreasNotice.append( $( '<em></em>', { 1537 text: l10n.noAreasRendered1537 text: wp.i18n.__( 'There are no widget areas currently rendered in the preview. Navigate in the preview to a template that makes use of a widget area in order to access its widgets here.' ) 1538 1538 } ) ); 1539 1539 panelMetaContainer.append( noRenderedAreasNotice ); 1540 1540 … … 1888 1888 1889 1889 addNewWidgetBtn.attr({ 'tabindex': '-1', 'aria-hidden': 'true' }); 1890 1890 reorderBtn.attr( 'aria-label', l10n.reorderLabelOff ); 1891 wp.a11y.speak( l10n.reorderModeOn);1891 wp.a11y.speak( wp.i18n.__( 'Reorder mode enabled' ) ); 1892 1892 // Hide widget titles while reordering: title is already in the reorder controls. 1893 1893 widgetsTitle.attr( 'aria-hidden', 'true' ); 1894 1894 } else { 1895 1895 addNewWidgetBtn.removeAttr( 'tabindex aria-hidden' ); 1896 1896 reorderBtn.attr( 'aria-label', l10n.reorderLabelOn ); 1897 wp.a11y.speak( l10n.reorderModeOff);1897 wp.a11y.speak( wp.i18n.__( 'Reorder mode closed' ) ); 1898 1898 widgetsTitle.attr( 'aria-hidden', 'false' ); 1899 1899 } 1900 1900 }, -
src/wp-admin/js/edit-comments.js
diff --git src/wp-admin/js/edit-comments.js src/wp-admin/js/edit-comments.js index 3de0310..6288564 100644
var getCount, updateCount, updateCountText, updatePending, updateApproved, 98 98 updateHtmlTitle = function ( diff ) { 99 99 var newTitle, regExMatch, titleCount, commentFrag; 100 100 101 titleRegEx = titleRegEx || new RegExp( adminCommentsL10n.docTitleCommentsCount.replace( '%s', '\\([0-9' + thousandsSeparator + ']+\\)' ) + '?' ); 101 /* translators: %s: comments count */ 102 titleRegEx = titleRegEx || new RegExp( wp.i18n.__( 'Comments (%s)' ).replace( '%s', '\\([0-9' + thousandsSeparator + ']+\\)' ) + '?' ); 102 103 // count funcs operate on a $'d element 103 104 titleDiv = titleDiv || $( '<div />' ); 104 105 newTitle = adminTitle; … … var getCount, updateCount, updateCountText, updatePending, updateApproved, 117 118 updateCount( titleDiv, titleCount ); 118 119 regExMatch = titleRegEx.exec( document.title ); 119 120 if ( regExMatch ) { 120 newTitle = document.title.replace( regExMatch[0], adminCommentsL10n.docTitleCommentsCount.replace( '%s', titleDiv.text() ) + ' ' ); 121 /* translators: %s: comments count */ 122 newTitle = document.title.replace( regExMatch[0], wp.i18n.__( 'Comments (%s)' ).replace( '%s', titleDiv.text() ) + ' ' ); 121 123 } 122 124 } else { 123 125 regExMatch = titleRegEx.exec( newTitle ); 124 126 if ( regExMatch ) { 125 newTitle = newTitle.replace( regExMatch[0], adminCommentsL10n.docTitleComments);127 newTitle = newTitle.replace( regExMatch[0], wp.i18n.__( 'Comments' ) ); 126 128 } 127 129 } 128 130 document.title = newTitle; … … setCommentsList = function() { 218 220 219 221 if ( c.is('.unapproved') ) { 220 222 if ( settings.data.id == replyID ) 221 replyButton.text( adminCommentsL10n.replyApprove);223 replyButton.text( wp.i18n.__( 'Approve and Reply' ) ); 222 224 223 225 c.find( '.row-actions span.view' ).addClass( 'hidden' ).end() 224 226 .find( 'div.comment_status' ).html( '0' ); 225 227 226 228 } else { 227 229 if ( settings.data.id == replyID ) 228 replyButton.text( adminCommentsL10n.reply);230 replyButton.text( wp.i18n.__( 'Reply' ) ); 229 231 230 232 c.find( '.row-actions span.view' ).removeClass( 'hidden' ).end() 231 233 .find( 'div.comment_status' ).html( '1' ); … … commentReply = { 607 609 }, 608 610 609 611 toggle : function(el) { 610 if ( 'none' !== $( el ).css( 'display' ) && ( $( '#replyrow' ).parent().is('#com-reply') || window.confirm( adminCommentsL10n.warnQuickEdit) ) ) {612 if ( 'none' !== $( el ).css( 'display' ) && ( $( '#replyrow' ).parent().is('#com-reply') || window.confirm( wp.i18n.__( "Are you sure you want to edit this comment?\nThe changes you made will be lost." ) ) ) ) { 611 613 $( el ).find( 'a.vim-q' ).click(); 612 614 } 613 615 }, … … commentReply = { 715 717 c.after(editRow); 716 718 717 719 if ( c.hasClass('unapproved') ) { 718 replyButton.text( adminCommentsL10n.replyApprove);720 replyButton.text( wp.i18n.__( 'Approve and Reply' ) ); 719 721 } else { 720 replyButton.text( adminCommentsL10n.reply);722 replyButton.text( wp.i18n.__( 'Reply' ) ); 721 723 } 722 724 723 725 $('#replyrow').fadeIn(300, function(){ $(this).show(); }); … … commentReply = { 875 877 return true; 876 878 } 877 879 878 return window.confirm( adminCommentsL10n.warnCommentChanges);880 return window.confirm( __( "Are you sure you want to do this?\nThe comment changes you made will be lost." ) ); 879 881 } 880 882 }; 881 883 -
src/wp-admin/js/inline-edit-post.js
diff --git src/wp-admin/js/inline-edit-post.js src/wp-admin/js/inline-edit-post.js index 3a65805..adad7ea 100644
1 /* global inlineEditL10n,ajaxurl, typenow */1 /* global ajaxurl, typenow */ 2 2 window.wp = window.wp || {}; 3 3 4 4 var inlineEditPost; … … inlineEditPost = { 95 95 if ( $(this).prop('checked') ) { 96 96 c = false; 97 97 var id = $(this).val(), theTitle; 98 theTitle = $('#inline_'+id+' .post_title').html() || inlineEditL10n.notitle;99 te += '<div id="ttle'+id+'"><a id="_'+id+'" class="ntdelbutton" title="' +inlineEditL10n.ntdeltitle+'">X</a>'+theTitle+'</div>';98 theTitle = $('#inline_'+id+' .post_title').html() || wp.i18n.__( '(no title)' ); 99 te += '<div id="ttle'+id+'"><a id="_'+id+'" class="ntdelbutton" title="' + wp.i18n.__( 'Remove From Bulk Edit' ) + '">X</a>'+theTitle+'</div>'; 100 100 } 101 101 }); 102 102 … … inlineEditPost = { 116 116 if ( 'post' === type ) { 117 117 // support multi taxonomies? 118 118 tax = 'post_tag'; 119 $('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma} );119 $('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: wp.i18n._x( ',', 'tag delimiter' ).trim() } ); 120 120 } 121 121 $('html, body').animate( { scrollTop: 0 }, 'fast' ); 122 122 }, … … inlineEditPost = { 184 184 var terms = $(this), 185 185 taxname = $(this).attr('id').replace('_' + id, ''), 186 186 textarea = $('textarea.tax_input_' + taxname, editRow), 187 comma = inlineEditL10n.comma;187 comma = wp.i18n._x( ',', 'tag delimiter' ).trim(); 188 188 189 189 terms.find( 'img' ).replaceWith( function() { return this.alt; } ); 190 190 terms = terms.text(); … … inlineEditPost = { 196 196 textarea.val(terms); 197 197 } 198 198 199 textarea.suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma} );199 textarea.suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: wp.i18n._x( ',', 'tag delimiter' ).trim() } ); 200 200 }); 201 201 202 202 // handle the post status … … inlineEditPost = { 276 276 $( inlineEditPost.what + id ).hide().fadeIn( 400, function() { 277 277 // Move focus back to the Quick Edit link. $( this ) is the row being animated. 278 278 $( this ).find( '.editinline' ).focus(); 279 wp.a11y.speak( inlineEditL10n.saved);279 wp.a11y.speak( wp.i18n.__( 'Changes saved.' ) ); 280 280 }); 281 281 } else { 282 282 r = r.replace( /<.[^<>]*?>/g, '' ); … … inlineEditPost = { 284 284 wp.a11y.speak( $errorSpan.text() ); 285 285 } 286 286 } else { 287 $errorSpan.html( inlineEditL10n.error).show();288 wp.a11y.speak( inlineEditL10n.error);287 $errorSpan.html( wp.i18n.__( 'Error while saving the changes.' ) ).show(); 288 wp.a11y.speak( wp.i18n.__( 'Error while saving the changes.' ), 'polite' ); 289 289 } 290 290 }, 291 291 'html'); -
src/wp-admin/js/inline-edit-tax.js
diff --git src/wp-admin/js/inline-edit-tax.js src/wp-admin/js/inline-edit-tax.js index 3bbf4fb..26587f0 100644
1 /* global inlineEditL10n,ajaxurl */1 /* global ajaxurl */ 2 2 window.wp = window.wp || {}; 3 3 4 4 var inlineEditTax; … … inlineEditTax = { 123 123 row.hide().fadeIn( 400, function() { 124 124 // Move focus back to the Quick Edit link. 125 125 row.find( '.editinline' ).focus(); 126 wp.a11y.speak( inlineEditL10n.saved);126 wp.a11y.speak( wp.i18n.__( 'Changes saved.' ), 'polite' ); 127 127 }); 128 128 129 129 } else { … … inlineEditTax = { 132 132 wp.a11y.speak( $errorSpan.text() ); 133 133 } 134 134 } else { 135 $errorSpan.html( inlineEditL10n.error).show();136 wp.a11y.speak( inlineEditL10n.error);135 $errorSpan.html( wp.i18n.__( 'Error while saving the changes.' ) ).show(); 136 wp.a11y.speak( wp.i18n.__( 'Error while saving the changes.' ), 'polite' ); 137 137 } 138 138 } 139 139 ); -
src/wp-admin/js/media.js
diff --git src/wp-admin/js/media.js src/wp-admin/js/media.js index e23adeb..77e0508 100644
1 /* global ajaxurl, attachMediaBoxL10n,_wpMediaGridSettings, showNotice */1 /* global ajaxurl, _wpMediaGridSettings, showNotice */ 2 2 3 3 var findPosts; 4 4 ( function( $ ){ … … var findPosts; 61 61 spinner.removeClass( 'is-active' ); 62 62 }).done( function( x ) { 63 63 if ( ! x.success ) { 64 $( '#find-posts-response' ).text( attachMediaBoxL10n.error);64 $( '#find-posts-response' ).text( wp.i18n.__( 'Could not load the preview image. Please reload the page and try again.' ) ); 65 65 } 66 66 67 67 $( '#find-posts-response' ).html( x.data ); 68 68 }).fail( function() { 69 $( '#find-posts-response' ).text( attachMediaBoxL10n.error);69 $( '#find-posts-response' ).text( wp.i18n.__( 'Could not load the preview image. Please reload the page and try again.' ) ); 70 70 }); 71 71 } 72 72 }; -
src/wp-admin/js/nav-menu.js
diff --git src/wp-admin/js/nav-menu.js src/wp-admin/js/nav-menu.js index 5a685a3..f62146e 100644
8 8 * @subpackage Administration 9 9 */ 10 10 11 /* global menus, postboxes, columns, isRtl, navMenuL10n,ajaxurl */11 /* global menus, postboxes, columns, isRtl, ajaxurl */ 12 12 13 13 var wpNavMenu; 14 14 … … var wpNavMenu; 577 577 if ( title ) { 578 578 titleEl.text( title ).removeClass( 'no-title' ); 579 579 } else { 580 titleEl.text( navMenuL10n.untitled).addClass( 'no-title' );580 titleEl.text( wp.i18n._x( '(no label)', 'missing menu item navigation label' ) ).addClass( 'no-title' ); 581 581 } 582 582 } ); 583 583 }, … … var wpNavMenu; 1019 1019 if ( 0 !== $('#menu-to-edit').length || 0 !== $('.menu-location-menus select').length ) { 1020 1020 window.onbeforeunload = function(){ 1021 1021 if ( api.menusChanged ) 1022 return navMenuL10n.saveAlert;1022 return wp.i18n.__( 'The changes you made will be lost if you navigate away from this page.' ); 1023 1023 }; 1024 1024 } else { 1025 1025 // Make the post boxes read-only, as they can't be used yet … … var wpNavMenu; 1159 1159 1160 1160 eventOnClickMenuDelete : function() { 1161 1161 // Delete warning AYS 1162 if ( window.confirm( navMenuL10n.warnDeleteMenu) ) {1162 if ( window.confirm( wp.i18n.__( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ) ) ) { 1163 1163 window.onbeforeunload = null; 1164 1164 return true; 1165 1165 } … … var wpNavMenu; 1189 1189 $item; 1190 1190 1191 1191 if( ! $items.length ) { 1192 $('.categorychecklist', panel).html( '<li><p>' + navMenuL10n.noResultsFound+ '</p></li>' );1192 $('.categorychecklist', panel).html( '<li><p>' + wp.i18n.__( 'No results found.' ) + '</p></li>' ); 1193 1193 $( '.spinner', panel ).removeClass( 'is-active' ); 1194 1194 return; 1195 1195 } -
src/wp-admin/js/plugin-install.js
diff --git src/wp-admin/js/plugin-install.js src/wp-admin/js/plugin-install.js index 71b0e70..a32d5dc 100644
1 /* global plugininstallL10n,tb_click, tb_remove */1 /* global tb_click, tb_remove */ 2 2 3 3 /** 4 4 * Functionality for the plugin install screens. … … jQuery( document ).ready( function( $ ) { 139 139 // Open the Plugin details modal. 140 140 $( '.thickbox.open-plugin-details-modal' ).on( 'click', function( e ) { 141 141 // The `data-title` attribute is used only in the Plugin screens. 142 var title = $( this ).data( 'title' ) ? plugininstallL10n.plugin_information + ' ' + $( this ).data( 'title' ) : plugininstallL10n.plugin_modal_label;142 var title = $( this ).data( 'title' ) ? wp.i18n.__( 'Plugin:' ) + ' ' + $( this ).data( 'title' ) : wp.i18n.__( 'Plugin details' ); 143 143 144 144 e.preventDefault(); 145 145 e.stopPropagation(); … … jQuery( document ).ready( function( $ ) { 152 152 // Set ARIA role and ARIA label. 153 153 tbWindow.attr({ 154 154 'role': 'dialog', 155 'aria-label': plugininstallL10n.plugin_modal_label155 'aria-label': wp.i18n.__( 'Plugin details' ) 156 156 }); 157 157 158 158 // Set title attribute on the iframe. -
src/wp-admin/js/post.js
diff --git src/wp-admin/js/post.js src/wp-admin/js/post.js index 5ca772b..94739b4 100644
1 /* global postL10n, ajaxurl, wpAjax, setPostThumbnailL10n, postboxes, pagenow, tinymce, alert, deleteUserSetting */1 /* global ajaxurl, wpAjax, postboxes, pagenow, tinymce, alert, deleteUserSetting */ 2 2 /* global theList:true, theExtraList:true, getUserSetting, setUserSetting, commentReply */ 3 3 4 4 var commentsBox, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint, makeSlugeditClickable, editPermalink; … … commentsBox = { 46 46 if ( commentsBox.st > commentsBox.total ) 47 47 $('#show-comments').hide(); 48 48 else 49 $('#show-comments').show().children('a').html( postL10n.showcomm);49 $('#show-comments').show().children('a').html( wp.i18n.__( 'Show more comments' ) ); 50 50 51 51 return; 52 52 } else if ( 1 == r ) { 53 $('#show-comments').html( postL10n.endcomm);53 $('#show-comments').html( wp.i18n.__( 'No more comments found.' ) ); 54 54 return; 55 55 } 56 56 … … WPRemoveThumbnail = function(nonce){ 83 83 action: 'set-post-thumbnail', post_id: $( '#post_ID' ).val(), thumbnail_id: -1, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie ) 84 84 }, function(str){ 85 85 if ( str == '0' ) { 86 alert( setPostThumbnailL10n.error);86 alert( wp.i18n.__( 'Could not set that as the thumbnail image. Try a different attachment.' ) ); 87 87 } else { 88 88 WPSetThumbnailHTML(str); 89 89 } … … jQuery(document).ready( function($) { 379 379 $submitButtons.removeClass( 'disabled' ); 380 380 } 381 381 }).on( 'before-autosave.edit-post', function() { 382 $( '.autosave-message' ).text( postL10n.savingText );382 $( '.autosave-message' ).text( wp.i18n.__( 'Saving...' ) ); // No ellipsis. 383 383 }).on( 'after-autosave.edit-post', function( event, data ) { 384 384 $( '.autosave-message' ).text( data.message ); 385 385 … … jQuery(document).ready( function($) { 394 394 if ( ( editor && ! editor.isHidden() && editor.isDirty() ) || 395 395 ( wp.autosave && wp.autosave.server.postChanged() ) ) { 396 396 397 return postL10n.saveAlert;397 return wp.i18n.__( 'The changes you made will be lost if you navigate away from this page.' ); 398 398 } 399 399 }).on( 'unload.edit-post', function( event ) { 400 400 if ( ! releaseLock ) { … … jQuery(document).ready( function($) { 576 576 } 577 577 578 578 if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) { 579 publishOn = postL10n.publishOnFuture;580 $('#publish').val( postL10n.schedule);579 publishOn = wp.i18n.__( 'Schedule for:' ); 580 $('#publish').val( wp.i18n.__( 'Schedule' ) ); 581 581 } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) { 582 publishOn = postL10n.publishOn;583 $('#publish').val( postL10n.publish);582 publishOn = wp.i18n.__( 'Publish on:' ); 583 $('#publish').val( wp.i18n.__( 'Publish' ) ); 584 584 } else { 585 publishOn = postL10n.publishOnPast;586 $('#publish').val( postL10n.update);585 publishOn = wp.i18n.__( 'Published on:' ); 586 $('#publish').val( wp.i18n.__( 'Update' ) ); 587 587 } 588 588 if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) { //hack 589 589 $('#timestamp').html(stamp); 590 590 } else { 591 591 $('#timestamp').html( 592 592 '\n' + publishOn + ' <b>' + 593 postL10n.dateFormat 593 /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */ 594 wp.i18n.__( '%1$s %2$s, %3$s @ %4$s:%5$s' ) 594 595 .replace( '%1$s', $( 'option[value="' + mm + '"]', '#mm' ).attr( 'data-text' ) ) 595 596 .replace( '%2$s', parseInt( jj, 10 ) ) 596 597 .replace( '%3$s', aa ) … … jQuery(document).ready( function($) { 601 602 } 602 603 603 604 if ( $postVisibilitySelect.find('input:radio:checked').val() == 'private' ) { 604 $('#publish').val( postL10n.update);605 $('#publish').val( wp.i18n.__( 'Update' ) ); 605 606 if ( 0 === optPublish.length ) { 606 postStatus.append('<option value="publish">' + postL10n.privatelyPublished+ '</option>');607 postStatus.append('<option value="publish">' + wp.i18n.__( 'Privately Published' ) + '</option>'); 607 608 } else { 608 optPublish.html( postL10n.privatelyPublished);609 optPublish.html( wp.i18n.__( 'Privately Published' ) ); 609 610 } 610 611 $('option[value="publish"]', postStatus).prop('selected', true); 611 612 $('#misc-publishing-actions .edit-post-status').hide(); … … jQuery(document).ready( function($) { 616 617 postStatus.val($('#hidden_post_status').val()); 617 618 } 618 619 } else { 619 optPublish.html( postL10n.published);620 optPublish.html( wp.i18n.__( 'Published' ) ); 620 621 } 621 622 if ( postStatus.is(':hidden') ) 622 623 $('#misc-publishing-actions .edit-post-status').show(); … … jQuery(document).ready( function($) { 627 628 } else { 628 629 $('#save-post').show(); 629 630 if ( $('option:selected', postStatus).val() == 'pending' ) { 630 $('#save-post').show().val( postL10n.savePending);631 $('#save-post').show().val( wp.i18n.__( 'Save as Pending' ) ); 631 632 } else { 632 $('#save-post').show().val( postL10n.saveDraft);633 $('#save-post').show().val( wp.i18n.__( 'Save Draft' ) ); 633 634 } 634 635 } 635 636 return true; … … jQuery(document).ready( function($) { 658 659 }); 659 660 660 661 $postVisibilitySelect.find('.save-post-visibility').click( function( event ) { // crazyhorse - multiple ok cancels 662 var visibility; 663 661 664 $postVisibilitySelect.slideUp('fast'); 662 665 $('#visibility .edit-visibility').show().focus(); 663 666 updateText(); … … jQuery(document).ready( function($) { 666 669 $('#sticky').prop('checked', false); 667 670 } // WEAPON LOCKED 668 671 669 if ( $('#sticky').prop('checked') ) { 670 sticky = 'Sticky'; 671 } else { 672 sticky = ''; 672 switch ( $postVisibilitySelect.find( 'input:radio:checked' ).val() ) { 673 case 'password': 674 visibility = wp.i18n.__( 'Password Protected' ); 675 break; 676 case 'private': 677 visibility = wp.i18n.__( 'Private' ); 678 break; 679 default: 680 visibility = $( '#sticky' ).prop( 'checked' ) ? wp.i18n.__( 'Public, Sticky' ) : wp.i18n.__( 'Public' ); 681 break; 673 682 } 674 683 675 $('#post-visibility-display').html( postL10n[ $postVisibilitySelect.find('input:radio:checked').val() + sticky ]);684 $('#post-visibility-display').html( visibility ); 676 685 event.preventDefault(); 677 686 }); 678 687 … … jQuery(document).ready( function($) { 768 777 $el = $( '#editable-post-name' ); 769 778 revert_e = $el.html(); 770 779 771 buttons.html( '<button type="button" class="save button button-small">' + postL10n.ok + '</button> <button type="button" class="cancel button-link">' + postL10n.cancel+ '</button>' );780 buttons.html( '<button type="button" class="save button button-small">' + wp.i18n.__( 'OK' ) + '</button> <button type="button" class="cancel button-link">' + wp.i18n.__( 'Cancel' ) + '</button>' ); 772 781 buttons.children( '.save' ).click( function() { 773 782 var new_slug = $el.children( 'input' ).val(); 774 783 … … jQuery(document).ready( function($) { 795 804 permalink.html(permalinkOrig); 796 805 real_slug.val(new_slug); 797 806 $( '.edit-slug' ).focus(); 798 wp.a11y.speak( postL10n.permalinkSaved);807 wp.a11y.speak( wp.i18n.__( 'Permalink saved' ), 'polite' ); 799 808 }); 800 809 }); 801 810 -
src/wp-admin/js/postbox.js
diff --git src/wp-admin/js/postbox.js src/wp-admin/js/postbox.js index a8222ee..691e231 100644
var postboxes; 202 202 t.removeClass('empty-container'); 203 203 } 204 204 else { 205 t.addClass( 'empty-container');206 t.attr( 'data-emptyString', postBoxL10n.postBoxEmptyString);205 t.addClass( 'empty-container' ); 206 t.attr( 'data-emptyString', wp.i18n.__( 'Drag boxes here' ) ); 207 207 } 208 208 }); 209 209 -
src/wp-admin/js/press-this.js
diff --git src/wp-admin/js/press-this.js src/wp-admin/js/press-this.js index bf2e830..e85ac64 100644
42 42 *************************************************************** */ 43 43 44 44 /** 45 * Emulates our PHP __() gettext function, powered by the strings exported in pressThisL10n.46 *47 * @param key string Key of the string to be translated, as found in pressThisL10n.48 * @returns string Original or translated string, or empty string if no key.49 */50 function __( key ) {51 if ( key && window.pressThisL10n ) {52 return window.pressThisL10n[key] || key;53 }54 55 return key || '';56 }57 58 /**59 45 * Strips HTML tags 60 46 * 61 47 * @param string string Text to have the HTML tags striped out of. … … 301 287 } 302 288 } 303 289 }).fail( function() { 304 renderError( __( 'serverError' ) );290 renderError( wp.i18n.__( 'Connection lost or the server is busy. Please try again later.' ) ); 305 291 }); 306 292 } 307 293 … … 451 437 var $element = $mediaThumbWrap.clone().addClass( 'is-image' ); 452 438 453 439 $element.attr( 'data-wp-src', src ).css( 'background-image', 'url(' + displaySrc + ')' ) 454 .find( 'span' ).text( __( 'suggestedImgAlt' ).replace( '%d', i + 1 ) ); 440 /* translators: %d: nth image found in a post */ 441 .find( 'span' ).text( wp.i18n.__( 'Suggested image #%d' ).replace( '%d', i + 1 ) ); 455 442 456 443 $mediaList.append( $element ); 457 444 } … … 490 477 cssClass += ' is-video'; 491 478 } 492 479 493 $element.attr( 'data-wp-src', src ).find( 'span' ).text( __( 'suggestedEmbedAlt' ).replace( '%d', i + 1 ) ); 480 /* translators: %d: nth embed found in a post */ 481 $element.attr( 'data-wp-src', src ).find( 'span' ).text( wp.i18n.__( 'Suggested embed #%d' ).replace( '%d', i + 1 ) ); 494 482 495 483 if ( displaySrc ) { 496 484 $element.css( 'background-image', 'url(' + displaySrc + ')' ); … … 854 842 855 843 $window.on( 'beforeunload.press-this', function() { 856 844 if ( saveAlert || ( editor && editor.isDirty() ) ) { 857 return __( 'saveAlert' );845 return wp.i18n.__( 'The changes you made will be lost if you navigate away from this page.' ); 858 846 } 859 847 } ).on( 'resize.press-this', function() { 860 848 if ( ! editor || editor.isHidden() ) { -
src/wp-admin/js/set-post-thumbnail.js
diff --git src/wp-admin/js/set-post-thumbnail.js src/wp-admin/js/set-post-thumbnail.js index 68abbcc..27c032b 100644
1 /* global setPostThumbnailL10n,ajaxurl, post_id, alert */1 /* global ajaxurl, post_id, alert */ 2 2 /* exported WPSetAsThumbnail */ 3 3 4 4 function WPSetAsThumbnail( id, nonce ) { 5 5 var $link = jQuery('a#wp-post-thumbnail-' + id); 6 6 7 $link.text( setPostThumbnailL10n.saving );7 $link.text( wp.i18n.__( 'Saving...' ) ); // No ellipsis. 8 8 jQuery.post(ajaxurl, { 9 9 action: 'set-post-thumbnail', post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie ) 10 10 }, function(str){ 11 11 var win = window.dialogArguments || opener || parent || top; 12 $link.text( setPostThumbnailL10n.setThumbnail);12 $link.text( wp.i18n.__( 'Use as featured image' ) ); 13 13 if ( str == '0' ) { 14 alert( setPostThumbnailL10n.error);14 alert( wp.i18n.__( 'Could not set that as the thumbnail image. Try a different attachment.' ) ); 15 15 } else { 16 16 jQuery('a.wp-post-thumbnail').show(); 17 $link.text( setPostThumbnailL10n.done);17 $link.text( wp.i18n.__( 'Done' ) ); 18 18 $link.fadeOut( 2000 ); 19 19 win.WPSetThumbnailID(id); 20 20 win.WPSetThumbnailHTML(str); -
src/wp-admin/js/tags-box.js
diff --git src/wp-admin/js/tags-box.js src/wp-admin/js/tags-box.js index af823ac..8766ec7 100644
var tagBox, array_unique_noempty; 21 21 22 22 tagBox = { 23 23 clean : function(tags) { 24 var comma = w indow.tagsBoxL10n.tagDelimiter;24 var comma = wp.i18n._x( ',', 'tag delimiter' ); 25 25 if ( ',' !== comma ) 26 26 tags = tags.replace(new RegExp(comma, 'g'), ','); 27 27 tags = tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, ''); … … var tagBox, array_unique_noempty; 35 35 num = id.split('-check-num-')[1], 36 36 taxbox = $(el).closest('.tagsdiv'), 37 37 thetags = taxbox.find('.the-tags'), 38 comma = w indow.tagsBoxL10n.tagDelimiter,38 comma = wp.i18n._x( ',', 'tag delimiter' ), 39 39 current_tags = thetags.val().split( comma ), 40 40 new_tags = []; 41 41 … … var tagBox, array_unique_noempty; 65 65 66 66 disabled = thetags.prop('disabled'); 67 67 68 current_tags = thetags.val().split( w indow.tagsBoxL10n.tagDelimiter);68 current_tags = thetags.val().split( wp.i18n._x( ',', 'tag delimiter' ) ); 69 69 tagchecklist.empty(); 70 70 71 71 $.each( current_tags, function( key, val ) { … … var tagBox, array_unique_noempty; 107 107 var tagsval, newtags, text, 108 108 tags = $( '.the-tags', el ), 109 109 newtag = $( 'input.newtag', el ), 110 comma = w indow.tagsBoxL10n.tagDelimiter;110 comma = wp.i18n._x( ',', 'tag delimiter' ); 111 111 112 112 a = a || false; 113 113 … … var tagBox, array_unique_noempty; 177 177 var tax = $(this).closest('div.tagsdiv').attr('id'); 178 178 $(this).suggest( 179 179 ajaxurl + '?action=ajax-tag-search&tax=' + tax, 180 { delay: 500, minchars: 2, multiple: true, multipleSep: w indow.tagsBoxL10n.tagDelimiter}180 { delay: 500, minchars: 2, multiple: true, multipleSep: wp.i18n._x( ',', 'tag delimiter' ) } 181 181 ); 182 182 }); 183 183 -
src/wp-admin/js/tags.js
diff --git src/wp-admin/js/tags.js src/wp-admin/js/tags.js index 333a2eb..5628ad0 100644
jQuery(document).ready(function($) { 16 16 $('select#parent option[value="' + data.match(/tag_ID=(\d+)/)[1] + '"]').remove(); 17 17 $('a.tag-link-' + data.match(/tag_ID=(\d+)/)[1]).remove(); 18 18 } else if ( '-1' == r ) { 19 $('#ajax-response').empty().append('<div class="error"><p>' + tagsl10n.noPerm+ '</p></div>');19 $('#ajax-response').empty().append('<div class="error"><p>' + wp.i18n.__( 'Sorry, you are not allowed to do that.' ) + '</p></div>'); 20 20 tr.children().css('backgroundColor', ''); 21 21 } else { 22 $('#ajax-response').empty().append('<div class="error"><p>' + tagsl10n.broken+ '</p></div>');22 $('#ajax-response').empty().append('<div class="error"><p>' + wp.i18n.__( 'An unidentified error has occurred.' ) + '</p></div>'); 23 23 tr.children().css('backgroundColor', ''); 24 24 } 25 25 }); -
src/wp-admin/js/theme.js
diff --git src/wp-admin/js/theme.js src/wp-admin/js/theme.js index 55706b3..77209ef 100644
window.wp = window.wp || {}; 4 4 ( function($) { 5 5 6 6 // Set up our namespace... 7 var themes, l10n; 8 themes = wp.themes = wp.themes || {}; 7 var themes = wp.themes = wp.themes || {}; 9 8 10 9 // Store the theme data and settings for organized and quick access 11 // themes.data.settings, themes.data.themes , themes.data.l10n10 // themes.data.settings, themes.data.themes 12 11 themes.data = _wpThemeSettings; 13 l10n = themes.data.l10n;14 12 15 13 // Shortcut for isInstall check 16 14 themes.isInstall = !! themes.data.settings.isInstall; … … themes.view.Appearance = wp.Backbone.View.extend({ 104 102 // Render and append after screen title 105 103 view.render(); 106 104 this.searchContainer 107 .append( $.parseHTML( '<label class="screen-reader-text" for="wp-filter-search-input">' + l10n.search+ '</label>' ) )105 .append( $.parseHTML( '<label class="screen-reader-text" for="wp-filter-search-input">' + wp.i18n.__( 'Search Themes' ) + '</label>' ) ) 108 106 .append( view.el ); 109 107 }, 110 108 … … themes.view.Preview = themes.view.Details.extend({ 916 914 collapse: function( event ) { 917 915 var $button = $( event.currentTarget ); 918 916 if ( 'true' === $button.attr( 'aria-expanded' ) ) { 919 $button.attr({ 'aria-expanded': 'false', 'aria-label': l10n.expandSidebar});917 $button.attr({ 'aria-expanded': 'false', 'aria-label': wp.i18n.__( 'Expand Sidebar' ) }); 920 918 } else { 921 $button.attr({ 'aria-expanded': 'true', 'aria-label': l10n.collapseSidebar});919 $button.attr({ 'aria-expanded': 'true', 'aria-label': wp.i18n.__( 'Collapse Sidebar' ) }); 922 920 } 923 921 924 922 this.$el.toggleClass( 'collapsed' ).toggleClass( 'expanded' ); … … themes.view.Themes = wp.Backbone.View.extend({ 1155 1153 1156 1154 // 'Add new theme' element shown at the end of the grid 1157 1155 if ( ! themes.isInstall && themes.data.settings.canInstall ) { 1158 this.$el.append( '<div class="theme add-new-theme"><a href="' + themes.data.settings.installURI + '"><div class="theme-screenshot"><span></span></div><h2 class="theme-name">' + l10n.addNew+ '</h2></a></div>' );1156 this.$el.append( '<div class="theme add-new-theme"><a href="' + themes.data.settings.installURI + '"><div class="theme-screenshot"><span></span></div><h2 class="theme-name">' + wp.i18n.__( 'Add New Theme' ) + '</h2></a></div>' ); 1159 1157 } 1160 1158 1161 1159 this.parent.page++; … … themes.view.Themes = wp.Backbone.View.extend({ 1211 1209 $modal.find( '.notice-warning' ) 1212 1210 .removeClass( 'notice-large' ) 1213 1211 .addClass( 'updating-message' ) 1214 .find( 'p' ).text( wp. updates.l10n.updating);1212 .find( 'p' ).text( wp.i18n.__( 'Updating...' ) ); 1215 1213 } else if ( $card.find( '.notice-error' ).length ) { 1216 1214 $modal.find( '.notice-warning' ).remove(); 1217 1215 } … … themes.view.Themes = wp.Backbone.View.extend({ 1287 1285 // Dispatch audible search results feedback message 1288 1286 announceSearchResults: function( count ) { 1289 1287 if ( 0 === count ) { 1290 wp.a11y.speak( l10n.noThemesFound);1288 wp.a11y.speak( __( 'No themes found. Try a different search.' ), 'polite' ); 1291 1289 } else { 1292 wp.a11y.speak( l10n.themesFound.replace( '%d', count ));1290 wp.a11y.speak( wp.i18n._n( '%d Theme found', '%d Themes found', count ).replace( '%d', count ), 'polite' ); 1293 1291 } 1294 1292 } 1295 1293 }); … … themes.view.Search = wp.Backbone.View.extend({ 1303 1301 searching: false, 1304 1302 1305 1303 attributes: { 1306 placeholder: l10n.searchPlaceholder,1304 placeholder: __( 'Search themes...' ), // No ellipsis. 1307 1305 type: 'search', 1308 1306 'aria-describedby': 'live-search-desc' 1309 1307 }, … … themes.view.Installer = themes.view.Appearance.extend({ 1584 1582 this.listenTo( this.collection, 'query:fail', function() { 1585 1583 $( 'body' ).removeClass( 'loading-content' ); 1586 1584 $( '.theme-browser' ).find( 'div.error' ).remove(); 1587 $( '.theme-browser' ).find( 'div.themes' ).before( '<div class="error"><p>' + l10n.error+ '</p></div>' );1585 $( '.theme-browser' ).find( 'div.themes' ).before( '<div class="error"><p>' + wp.i18n.__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ) + '</p></div>' ); 1588 1586 }); 1589 1587 1590 1588 if ( this.view ) { -
src/wp-admin/js/updates.js
diff --git src/wp-admin/js/updates.js src/wp-admin/js/updates.js index 239829f..6298c7f 100644
14 14 * @param {object} wp WP object. 15 15 * @param {object} settings WP Updates settings. 16 16 * @param {string} settings.ajax_nonce AJAX nonce. 17 * @param { object} settings.l10n Translation strings.17 * @param {bool} settings.isNetworkAdmin Whether we're in the network admin or not. 18 18 * @param {object=} settings.plugins Base names of plugins in their different states. 19 19 * @param {Array} settings.plugins.all Base names of all plugins. 20 20 * @param {Array} settings.plugins.active Base names of active plugins. … … 50 50 wp.updates.ajaxNonce = settings.ajax_nonce; 51 51 52 52 /** 53 * Localized strings.53 * Whether we're in the network admin or not. 54 54 * 55 * @since 4. 2.055 * @since 4.7.0 56 56 * 57 * @type { object}57 * @type {bool} 58 58 */ 59 wp.updates. l10n = settings.l10n;59 wp.updates.isNetworkAdmin = settings.isNetworkAdmin; 60 60 61 61 /** 62 62 * Current search term. … … 351 351 if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) { 352 352 $updateRow = $( 'tr[data-plugin="' + args.plugin + '"]' ); 353 353 $message = $updateRow.find( '.update-message' ).removeClass( 'notice-error' ).addClass( 'updating-message notice-warning' ).find( 'p' ); 354 message = wp.updates.l10n.updatingLabel.replace( '%s', $updateRow.find( '.plugin-title strong' ).text() ); 354 /* translators: %s: Plugin name and version */ 355 message = wp.i18n.__( 'Updating %s...' ).replace( '%s', $updateRow.find( '.plugin-title strong' ).text() ); 355 356 } else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) { 356 357 $card = $( '.plugin-card-' + args.slug ); 357 358 $message = $card.find( '.update-now' ).addClass( 'updating-message' ); 358 message = wp.updates.l10n.updatingLabel.replace( '%s', $message.data( 'name' ) ); 359 /* translators: %s: Plugin name and version */ 360 message = wp.i18n.__( 'Updating %s...' ).replace( '%s', $message.data( 'name' ) ); 359 361 360 362 // Remove previous error messages, if any. 361 363 $card.removeClass( 'plugin-card-update-failed' ).find( '.notice.notice-error' ).remove(); 362 364 } 363 365 364 if ( $message.html() !== wp. updates.l10n.updating) {366 if ( $message.html() !== wp.i18n.__( 'Updating...' ) ) { 365 367 $message.data( 'originaltext', $message.html() ); 366 368 } 367 369 368 370 $message 369 371 .attr( 'aria-label', message ) 370 .text( wp. updates.l10n.updating);372 .text( wp.i18n.__( 'Updating...' ) ); 371 373 372 374 $document.trigger( 'wp-plugin-updating', args ); 373 375 … … 409 411 } 410 412 411 413 $updateMessage 412 .attr( 'aria-label', wp.updates.l10n.updatedLabel.replace( '%s', response.pluginName ) ) 413 .text( wp.updates.l10n.updated ); 414 /* translators: %s: Plugin name and version */ 415 .attr( 'aria-label', wp.i18n.__( '%s updated!' ).replace( '%s', response.pluginName ) ) 416 .text( wp.i18n.__( 'Updated!' ) ); 414 417 415 wp.a11y.speak( wp.updates.l10n.updatedMsg, 'polite' ); 418 /* translators: JavaScript accessible string */ 419 wp.a11y.speak( wp.i18n.__( 'Update completed successfully.' ), 'polite' ); 416 420 417 421 wp.updates.decrementCount( 'plugin' ); 418 422 … … 444 448 return; 445 449 } 446 450 447 errorMessage = wp.updates.l10n.updateFailed.replace( '%s', response.errorMessage ); 451 /* translators: %s: Error string for a failed update */ 452 errorMessage = wp.i18n.__( 'Update Failed: %s' ).replace( '%s', response.errorMessage ); 448 453 449 454 if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) { 450 455 if ( response.plugin ) { … … 456 461 457 462 if ( response.pluginName ) { 458 463 $message.find( 'p' ) 459 .attr( 'aria-label', wp.updates.l10n.updateFailedLabel.replace( '%s', response.pluginName ) ); 464 /* translators: %s: Plugin name and version */ 465 .attr( 'aria-label', wp.i18n.__( '%s update failed' ).replace( '%s', response.pluginName ) ); 460 466 } else { 461 467 $message.find( 'p' ).removeAttr( 'aria-label' ); 462 468 } … … 469 475 } ) ); 470 476 471 477 $card.find( '.update-now' ) 472 .text( wp. updates.l10n.updateFailedShort).removeClass( 'updating-message' );478 .text( wp.i18n.__( 'Update Failed!' ) ).removeClass( 'updating-message' ); 473 479 474 480 if ( response.pluginName ) { 475 481 $card.find( '.update-now' ) 476 .attr( 'aria-label', wp.updates.l10n.updateFailedLabel.replace( '%s', response.pluginName ) ); 482 /* translators: %s: Plugin name and version */ 483 .attr( 'aria-label', wp.i18n.__( '%s update failed' ).replace( '%s', response.pluginName ) ); 477 484 } else { 478 485 $card.find( '.update-now' ).removeAttr( 'aria-label' ); 479 486 } … … 488 495 489 496 $card.find( '.update-now' ) 490 497 .attr( 'aria-label', false ) 491 .text( wp. updates.l10n.updateNow);498 .text( wp.i18n.__( 'Update Now' ) ); 492 499 }, 200 ); 493 500 } ); 494 501 } … … 523 530 $message = $( '[data-slug="' + args.slug + '"]' ); 524 531 } 525 532 526 if ( $message.html() !== wp. updates.l10n.installing) {533 if ( $message.html() !== wp.i18n.__( 'Installing...' ) ) { 527 534 $message.data( 'originaltext', $message.html() ); 528 535 } 529 536 530 537 $message 531 538 .addClass( 'updating-message' ) 532 .attr( 'aria-label', wp.updates.l10n.pluginInstallingLabel.replace( '%s', $message.data( 'name' ) ) ) 533 .text( wp.updates.l10n.installing ); 539 /* translators: %s: Plugin name and version */ 540 .attr( 'aria-label', wp.i18n._x( 'Installing %s...', 'plugin' ).replace( '%s', $message.data( 'name' ) ) ) 541 .text( wp.i18n.__( 'Installing...' ) ); 534 542 535 wp.a11y.speak( wp. updates.l10n.installingMsg, 'polite' );543 wp.a11y.speak( wp.i18n.__( 'Installing... please wait.' ), 'polite' ); 536 544 537 545 // Remove previous error messages, if any. 538 546 $card.removeClass( 'plugin-card-install-failed' ).find( '.notice.notice-error' ).remove(); … … 554 562 * @param {string} response.activateUrl URL to activate the just installed plugin. 555 563 */ 556 564 wp.updates.installPluginSuccess = function( response ) { 557 var $message = $( '.plugin-card-' + response.slug ).find( '.install-now' ); 565 var $message = $( '.plugin-card-' + response.slug ).find( '.install-now' ), 566 activatePlugin = wp.i18n.__( 'Activate' ), 567 /* translators: %s: Plugin name */ 568 activatePluginLabel = wp.i18n._x( 'Activate %s', 'plugin' ); 558 569 559 570 $message 560 571 .removeClass( 'updating-message' ) 561 572 .addClass( 'updated-message installed button-disabled' ) 562 .attr( 'aria-label', wp.updates.l10n.pluginInstalledLabel.replace( '%s', response.pluginName ) ) 563 .text( wp.updates.l10n.installed ); 573 /* translators: %s: Plugin name and version */ 574 .attr( 'aria-label', wp.i18n._x( '%s installed!', 'plugin' ).replace( '%s', response.pluginName ) ) 575 .text( wp.i18n.__( 'Installed!' ) ); 564 576 565 wp.a11y.speak( wp. updates.l10n.installedMsg, 'polite' );577 wp.a11y.speak( wp.i18n.__( 'Installation completed successfully.' ), 'polite' ); 566 578 567 579 $document.trigger( 'wp-plugin-install-success', response ); 568 580 569 581 if ( response.activateUrl ) { 570 582 setTimeout( function() { 583 if ( wp.updates.isNetworkAdmin ) { 584 activatePlugin = wp.i18n.__( 'Network Activate' ); 585 /* translators: %s: Plugin name */ 586 activatePluginLabel = wp.i18n._x( 'Network Activate %s', 'plugin' ); 587 } 571 588 572 589 // Transform the 'Install' button into an 'Activate' button. 573 590 $message.removeClass( 'install-now installed button-disabled updated-message' ).addClass( 'activate-now button-primary' ) 574 591 .attr( 'href', response.activateUrl ) 575 .attr( 'aria-label', wp.updates.l10n.activatePluginLabel.replace( '%s', response.pluginName ) )576 .text( wp.updates.l10n.activatePlugin );592 .attr( 'aria-label', activatePluginLabel.replace( '%s', response.pluginName ) ) 593 .text( activatePlugin ); 577 594 }, 1000 ); 578 595 } 579 596 }; … … 603 620 return; 604 621 } 605 622 606 errorMessage = wp.updates.l10n.installFailed.replace( '%s', response.errorMessage ); 623 /* translators: %s: Error string for a failed installation */ 624 errorMessage = wp.i18n.__( 'Installation failed: %s' ).replace( '%s', response.errorMessage ); 607 625 608 626 $card 609 627 .addClass( 'plugin-card-update-failed' ) … … 621 639 622 640 $button 623 641 .removeClass( 'updating-message' ).addClass( 'button-disabled' ) 624 .attr( 'aria-label', wp.updates.l10n.pluginInstallFailedLabel.replace( '%s', $button.data( 'name' ) ) ) 625 .text( wp.updates.l10n.installFailedShort ); 642 /* translators: %s: Plugin name and version */ 643 .attr( 'aria-label', wp.i18n._x( '%s installation failed', 'plugin' ).replace( '%s', $button.data( 'name' ) ) ) 644 .text( wp.i18n.__( 'Install Failed!' ) ); 626 645 627 646 wp.a11y.speak( errorMessage, 'assertive' ); 628 647 … … 644 663 wp.updates.addAdminNotice( { 645 664 id: 'install-success', 646 665 className: 'notice-success is-dismissible', 647 message: wp.updates.l10n.importerInstalledMsg.replace( '%s', response.activateUrl + '&from=import' ) 666 /* translators: %s: Activation URL */ 667 message: wp.i18n.__( 'Importer installed successfully. <a href="%s">Run importer</a>' ).replace( '%s', response.activateUrl + '&from=import' ) 648 668 } ); 649 669 650 670 $( '[data-slug="' + response.slug + '"]' ) … … 652 672 .addClass( 'activate-now' ) 653 673 .attr({ 654 674 'href': response.activateUrl + '&from=import', 655 'aria-label': wp.updates.l10n.activateImporterLabel.replace( '%s', response.pluginName ) 675 /* translators: %s: Importer name */ 676 'aria-label': wp.i18n.__( 'Run %s' ).replace( '%s', response.pluginName ) 656 677 }) 657 .text( wp. updates.l10n.activateImporter);678 .text( wp.i18n.__( 'Run Importer' ) ); 658 679 659 wp.a11y.speak( wp. updates.l10n.installedMsg, 'polite' );680 wp.a11y.speak( wp.i18n.__( 'Installation completed successfully.' ), 'polite' ); 660 681 661 682 $document.trigger( 'wp-importer-install-success', response ); 662 683 }; … … 674 695 * @param {string} response.errorMessage The error that occurred. 675 696 */ 676 697 wp.updates.installImporterError = function( response ) { 677 var errorMessage = wp.updates.l10n.installFailed.replace( '%s', response.errorMessage ), 698 /* translators: %s: Error string for a failed installation */ 699 var errorMessage = wp.i18n.__( 'Installation failed: %s' ).replace( '%s', response.errorMessage ), 678 700 $installLink = $( '[data-slug="' + response.slug + '"]' ), 679 701 pluginName = $installLink.data( 'name' ); 680 702 … … 694 716 695 717 $installLink 696 718 .removeClass( 'updating-message' ) 697 .text( wp.updates.l10n.installNow ) 698 .attr( 'aria-label', wp.updates.l10n.installNowLabel.replace( '%s', pluginName ) ); 719 .text( wp.i18n.__( 'Install Now' ) ) 720 /* translators: %s: Plugin name */ 721 .attr( 'aria-label', wp.i18n.__( 'Install %s now' ).replace( '%s', pluginName ) ); 699 722 700 723 wp.a11y.speak( errorMessage, 'assertive' ); 701 724 … … 723 746 error: wp.updates.deletePluginError 724 747 }, args ); 725 748 726 if ( $link.html() !== wp. updates.l10n.deleting) {749 if ( $link.html() !== wp.i18n.__( 'Deleting...' ) ) { 727 750 $link 728 751 .data( 'originaltext', $link.html() ) 729 .text( wp. updates.l10n.deleting);752 .text( wp.i18n.__( 'Deleting...' ) ); 730 753 } 731 754 732 wp.a11y.speak( wp. updates.l10n.deleting, 'polite' );755 wp.a11y.speak( wp.i18n.__( 'Deleting...' ), 'polite' ); 733 756 734 757 $document.trigger( 'wp-plugin-deleting', args ); 735 758 … … 816 839 $views.find( '.all' ).remove(); 817 840 818 841 if ( ! $form.find( 'tr.no-items' ).length ) { 819 $form.find( '#the-list' ).append( '<tr class="no-items"><td class="colspanchange" colspan="' + columnCount + '">' + wp. updates.l10n.noPlugins+ '</td></tr>' );842 $form.find( '#the-list' ).append( '<tr class="no-items"><td class="colspanchange" colspan="' + columnCount + '">' + wp.i18n.__( 'You do not appear to have any plugins available at this time.' ) + '</td></tr>' ); 820 843 } 821 844 } 822 845 } ); 823 846 824 wp.a11y.speak( wp. updates.l10n.deleted, 'polite' );847 wp.a11y.speak( wp.i18n.__( 'Deleted!' ), 'polite' ); 825 848 826 849 $document.trigger( 'wp-plugin-delete-success', response ); 827 850 }; … … 916 939 $notice = $notice.addClass( 'updating-message' ).find( 'p' ); 917 940 } 918 941 919 if ( $notice.html() !== wp. updates.l10n.updating) {942 if ( $notice.html() !== wp.i18n.__( 'Updating...' ) ) { 920 943 $notice.data( 'originaltext', $notice.html() ); 921 944 } 922 945 923 wp.a11y.speak( wp.updates.l10n.updatingMsg, 'polite' ); 924 $notice.text( wp.updates.l10n.updating ); 946 /* translators: JavaScript accessible string */ 947 wp.a11y.speak( __( 'Updating... please wait.' ), 'polite' ); // No ellipsis. 948 $notice.text( wp.i18n.__( 'Updating...' ) ); // No ellipsis. 925 949 926 950 $document.trigger( 'wp-theme-updating', args ); 927 951 … … 945 969 $theme = $( '[data-slug="' + response.slug + '"]' ), 946 970 updatedMessage = { 947 971 className: 'updated-message notice-success notice-alt', 948 message: wp. updates.l10n.updated972 message: wp.i18n.__( 'Updated!' ) 949 973 }, 950 974 $notice, newText; 951 975 … … 967 991 } 968 992 969 993 wp.updates.addAdminNotice( _.extend( { selector: $notice }, updatedMessage ) ); 970 wp.a11y.speak( wp.updates.l10n.updatedMsg, 'polite' ); 994 /* translators: JavaScript accessible string */ 995 wp.a11y.speak( wp.i18n.__( 'Update completed successfully.' ), 'polite' ); 971 996 972 997 wp.updates.decrementCount( 'theme' ); 973 998 … … 992 1017 */ 993 1018 wp.updates.updateThemeError = function( response ) { 994 1019 var $theme = $( '[data-slug="' + response.slug + '"]' ), 995 errorMessage = wp.updates.l10n.updateFailed.replace( '%s', response.errorMessage ), 1020 /* translators: %s: Error string for a failed update */ 1021 errorMessage = wp.i18n.__( 'Update Failed: %s' ).replace( '%s', response.errorMessage ), 996 1022 $notice; 997 1023 998 1024 if ( ! wp.updates.isValidResponse( response, 'update' ) ) { … … 1044 1070 1045 1071 $message.addClass( 'updating-message' ); 1046 1072 $message.parents( '.theme' ).addClass( 'focus' ); 1047 if ( $message.html() !== wp. updates.l10n.installing) {1073 if ( $message.html() !== wp.i18n.__( 'Installing...' ) ) { 1048 1074 $message.data( 'originaltext', $message.html() ); 1049 1075 } 1050 1076 1051 1077 $message 1052 .text( wp.updates.l10n.installing ) 1053 .attr( 'aria-label', wp.updates.l10n.themeInstallingLabel.replace( '%s', $message.data( 'name' ) ) ); 1054 wp.a11y.speak( wp.updates.l10n.installingMsg, 'polite' ); 1078 .text( wp.i18n__( 'Installing...' ) ) 1079 /* translators: %s: Theme name and version */ 1080 .attr( 'aria-label', wp.i18n._x( 'Installing %s...', 'theme' ).replace( '%s', $message.data( 'name' ) ) ); 1081 wp.a11y.speak( wp.i18n.__( 'Installing... please wait.' ), 'polite' ); 1055 1082 1056 1083 // Remove previous error messages, if any. 1057 1084 $( '.install-theme-info, [data-slug="' + args.slug + '"]' ).removeClass( 'theme-install-failed' ).find( '.notice.notice-error' ).remove(); … … 1073 1100 * @param {string} response.activateUrl URL to activate the just installed theme. 1074 1101 */ 1075 1102 wp.updates.installThemeSuccess = function( response ) { 1076 var $card = $( '.wp-full-overlay-header, [data-slug=' + response.slug + ']' ), 1077 $message; 1103 var $card = $( '.wp-full-overlay-header, [data-slug=' + response.slug + ']' ), 1104 activateTheme = wp.i18n.__( 'Activate' ), 1105 activateThemeLabel = wp.i18n._x( 'Activate %s', 'theme' ), 1106 $message; 1078 1107 1079 1108 $document.trigger( 'wp-theme-install-success', response ); 1080 1109 1081 1110 $message = $card.find( '.button-primary' ) 1082 1111 .removeClass( 'updating-message' ) 1083 1112 .addClass( 'updated-message disabled' ) 1084 .attr( 'aria-label', wp.updates.l10n.themeInstalledLabel.replace( '%s', response.themeName ) ) 1085 .text( wp.updates.l10n.installed ); 1113 /* translators: %s: Theme name and version */ 1114 .attr( 'aria-label', wp.i18n._x( '%s installed!', 'theme' ).replace( '%s', response.themeName ) ) 1115 .text( wp.i18n.__( 'Installed!' ) ); 1086 1116 1087 wp.a11y.speak( wp. updates.l10n.installedMsg, 'polite' );1117 wp.a11y.speak( wp.i18n.__( 'Installation completed successfully.' ), 'polite' ); 1088 1118 1089 1119 setTimeout( function() { 1090 1120 1091 1121 if ( response.activateUrl ) { 1122 if ( wp.updates.isNetworkAdmin ) { 1123 activateTheme = wp.i18n.__( 'Network Enable' ); 1124 /* translators: %s: Theme name */ 1125 activateThemeLabel = wp.i18n._x( 'Network Activate %s', 'theme' ); 1126 } 1092 1127 1093 1128 // Transform the 'Install' button into an 'Activate' button. 1094 1129 $message 1095 1130 .attr( 'href', response.activateUrl ) 1096 1131 .removeClass( 'theme-install updated-message disabled' ) 1097 1132 .addClass( 'activate' ) 1098 .attr( 'aria-label', wp.updates.l10n.activateThemeLabel.replace( '%s', response.themeName ) )1099 .text( wp.updates.l10n.activateTheme );1133 .attr( 'aria-label', activateThemeLabel.replace( '%s', response.themeName ) ) 1134 .text( activateTheme ); 1100 1135 } 1101 1136 1102 1137 if ( response.customizeUrl ) { … … 1106 1141 return $( '<a>' ) 1107 1142 .attr( 'href', response.customizeUrl ) 1108 1143 .addClass( 'button button-secondary load-customize' ) 1109 .text( wp. updates.l10n.livePreview);1144 .text( wp.i18n.__( 'Live Preview' ) ); 1110 1145 } ); 1111 1146 } 1112 1147 }, 1000 ); … … 1125 1160 */ 1126 1161 wp.updates.installThemeError = function( response ) { 1127 1162 var $card, $button, 1128 errorMessage = wp.updates.l10n.installFailed.replace( '%s', response.errorMessage ), 1163 /* translators: %s: Error string for a failed installation */ 1164 errorMessage = wp.i18n.__( 'Installation failed: %s' ).replace( '%s', response.errorMessage ), 1129 1165 $message = wp.updates.adminNotice( { 1130 1166 className: 'update-message notice-error notice-alt', 1131 1167 message: errorMessage … … 1149 1185 1150 1186 $button 1151 1187 .removeClass( 'updating-message' ) 1152 .attr( 'aria-label', wp.updates.l10n.themeInstallFailedLabel.replace( '%s', $button.data( 'name' ) ) ) 1153 .text( wp.updates.l10n.installFailedShort ); 1188 /* translators: %s: Theme name and version */ 1189 .attr( 'aria-label', wp.i18n._x( '%s installation failed', 'theme' ).replace( '%s', $button.data( 'name' ) ) ) 1190 .text( wp.i18n.__( 'Install Failed!' ) ); 1154 1191 1155 1192 wp.a11y.speak( errorMessage, 'assertive' ); 1156 1193 … … 1183 1220 error: wp.updates.deleteThemeError 1184 1221 }, args ); 1185 1222 1186 if ( $button && $button.html() !== wp. updates.l10n.deleting) {1223 if ( $button && $button.html() !== wp.i18n.__( 'Deleting...' ) ) { 1187 1224 $button 1188 1225 .data( 'originaltext', $button.html() ) 1189 .text( wp. updates.l10n.deleting);1226 .text( wp.i18n.__( 'Deleting...' ) ); 1190 1227 } 1191 1228 1192 wp.a11y.speak( wp. updates.l10n.deleting, 'polite' );1229 wp.a11y.speak( wp.i18n.__( 'Deleting...' ), 'polite' ); 1193 1230 1194 1231 // Remove previous error messages, if any. 1195 1232 $( '.theme-info .update-message' ).remove(); … … 1253 1290 } ); 1254 1291 } 1255 1292 1256 wp.a11y.speak( wp. updates.l10n.deleted, 'polite' );1293 wp.a11y.speak( wp.i18n.__( 'Deleted!' ), 'polite' ); 1257 1294 1258 1295 $document.trigger( 'wp-theme-delete-success', response ); 1259 1296 }; … … 1274 1311 $button = $( '.theme-actions .delete-theme' ), 1275 1312 updateRow = wp.template( 'item-update-row' ), 1276 1313 $updateRow = $themeRow.siblings( '#' + response.slug + '-update' ), 1277 errorMessage = wp.updates.l10n.deleteFailed.replace( '%s', response.errorMessage ), 1314 /* translators: %s: Error string for a failed deletion */ 1315 errorMessage = wp.i18n.__( 'Deletion failed: %s' ).replace( '%s', response.errorMessage ), 1278 1316 $message = wp.updates.adminNotice( { 1279 1317 className: 'update-message notice-error notice-alt', 1280 1318 message: errorMessage … … 1566 1604 * 'update' or 'install'. 1567 1605 */ 1568 1606 wp.updates.isValidResponse = function( response, action ) { 1569 var error = wp. updates.l10n.unknownError,1607 var error = wp.i18n.__( 'An unknown error occurred' ), 1570 1608 errorMessage; 1571 1609 1572 1610 // Make sure the response is a valid data object and not a Promise object. … … 1575 1613 } 1576 1614 1577 1615 if ( _.isString( response ) && '-1' === response ) { 1578 error = wp. updates.l10n.nonceError;1616 error = wp.i18n.__( 'An error has occurred. Please reload the page and try again.' ); 1579 1617 } else if ( _.isString( response ) ) { 1580 1618 error = response; 1581 1619 } else if ( 'undefined' !== typeof response.readyState && 0 === response.readyState ) { 1582 error = wp. updates.l10n.connectionError;1620 error = wp.i18n.__( 'Connection lost or the server is busy. Please try again later.' ); 1583 1621 } else if ( _.isString( response.responseText ) && '' !== response.responseText ) { 1584 1622 error = response.responseText; 1585 1623 } else if ( _.isString( response.statusText ) ) { … … 1588 1626 1589 1627 switch ( action ) { 1590 1628 case 'update': 1591 errorMessage = wp.updates.l10n.updateFailed; 1629 /* translators: %s: Error string for a failed update */ 1630 errorMessage = wp.i18n.__( 'Update Failed: %s' ); 1592 1631 break; 1593 1632 1594 1633 case 'install': 1595 errorMessage = wp.updates.l10n.installFailed; 1634 /* translators: %s: Error string for a failed installation */ 1635 errorMessage = wp.i18n.__( 'Installation failed: %s' ); 1596 1636 break; 1597 1637 1598 1638 case 'delete': 1599 errorMessage = wp.updates.l10n.deleteFailed; 1639 /* translators: %s: Error string for a failed deletion */ 1640 errorMessage = wp.i18n.__( 'Deletion failed: %s' ); 1600 1641 break; 1601 1642 } 1602 1643 … … 1620 1661 .removeClass( 'updating-message' ) 1621 1662 .removeAttr( 'aria-label' ) 1622 1663 .prop( 'disabled', true ) 1623 .text( wp. updates.l10n.updateFailedShort);1664 .text( wp.i18n.__( 'Update Failed!' ) ); 1624 1665 1625 1666 $( '.updating-message:not(.button):not(.thickbox)' ) 1626 1667 .removeClass( 'updating-message notice-warning' ) … … 1644 1685 */ 1645 1686 wp.updates.beforeunload = function() { 1646 1687 if ( wp.updates.ajaxLocked ) { 1647 return wp. updates.l10n.beforeunload;1688 return wp.i18n.__( 'Updates may not complete if you navigate away from this page.' ); 1648 1689 } 1649 1690 }; 1650 1691 … … 1749 1790 1750 1791 if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) { 1751 1792 if ( 'update-plugin' === job.action ) { 1752 $message.attr( 'aria-label', wp.updates.l10n.updateNowLabel.replace( '%s', $message.data( 'name' ) ) ); 1793 /* translators: %s: Plugin name and version */ 1794 $message.attr( 'aria-label', wp.i18n.__( 'Update %s now' ).replace( '%s', $message.data( 'name' ) ) ); 1753 1795 } else if ( 'install-plugin' === job.action ) { 1754 $message.attr( 'aria-label', wp.updates.l10n.installNowLabel.replace( '%s', $message.data( 'name' ) ) ); 1796 /* translators: %s: Plugin name */ 1797 $message.attr( 'aria-label', wp.i18n.__( 'Install %s now' ).replace( '%s', $message.data( 'name' ) ) ); 1755 1798 } 1756 1799 } 1757 1800 } 1758 1801 1759 wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' ); 1802 /* translators: JavaScript accessible string */ 1803 wp.a11y.speak( wp.i18n.__( 'Update canceled.' ), 'polite' ); 1760 1804 } ); 1761 1805 1762 1806 /** … … 1832 1876 1833 1877 $message 1834 1878 .removeClass( 'updating-message' ) 1835 .text( wp. updates.l10n.installNow);1879 .text( wp.i18n.__( 'Install Now' ) ); 1836 1880 1837 wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' ); 1881 /* translators: JavaScript accessible string */ 1882 wp.a11y.speak( wp.i18n.__( 'Update canceled.' ), 'polite' ); 1838 1883 } ); 1839 1884 } 1840 1885 … … 1867 1912 1868 1913 $button 1869 1914 .removeClass( 'updating-message' ) 1870 .text( wp.updates.l10n.installNow ) 1871 .attr( 'aria-label', wp.updates.l10n.installNowLabel.replace( '%s', pluginName ) ); 1915 .text( wp.i18n.__( 'Install Now' ) ) 1916 /* translators: %s: Plugin name */ 1917 .attr( 'aria-label', wp.i18n.__( 'Install %s now' ).replace( '%s', pluginName ) ); 1872 1918 1873 wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' ); 1919 /* translators: JavaScript accessible string */ 1920 wp.a11y.speak( wp.i18n.__( 'Update canceled.' ), 'polite' ); 1874 1921 } ); 1875 1922 } 1876 1923 … … 1893 1940 1894 1941 event.preventDefault(); 1895 1942 1896 if ( ! window.confirm( wp.updates.l10n.aysDeleteUninstall.replace( '%s', $pluginRow.find( '.plugin-title strong' ).text() ) ) ) { 1943 /* translators: %s: Plugin name */ 1944 if ( ! window.confirm( wp.i18n.__( 'Are you sure you want to delete %s and its data?' ).replace( '%s', $pluginRow.find( '.plugin-title strong' ).text() ) ) ) { 1897 1945 return; 1898 1946 } 1899 1947 … … 1944 1992 1945 1993 event.preventDefault(); 1946 1994 1947 if ( ! window.confirm( wp.updates.l10n.aysDelete.replace( '%s', $themeRow.find( '.theme-title strong' ).text() ) ) ) { 1995 /* translators: %s: Theme name */ 1996 if ( ! window.confirm( wp.i18n.__( 'Are you sure you want to delete %s?' ).replace( '%s', $themeRow.find( '.theme-title strong' ).text() ) ) ) { 1948 1997 return; 1949 1998 } 1950 1999 … … 1970 2019 success = 0, 1971 2020 error = 0, 1972 2021 errorMessages = [], 1973 type, action ;2022 type, action, bulkDeleteMsg; 1974 2023 1975 2024 // Determine which type of item we're dealing with. 1976 2025 switch ( pagenow ) { … … 1995 2044 return wp.updates.addAdminNotice( { 1996 2045 id: 'no-items-selected', 1997 2046 className: 'notice-error is-dismissible', 1998 message: wp. updates.l10n.noItemsSelected2047 message: wp.i18n.__( 'Please select at least one item to perform this action on.' ) 1999 2048 } ); 2000 2049 } 2001 2050 … … 2006 2055 break; 2007 2056 2008 2057 case 'delete-selected': 2009 if ( ! window.confirm( 'plugin' === type ? wp.updates.l10n.aysBulkDelete : wp.updates.l10n.aysBulkDeleteThemes ) ) { 2058 bulkDeleteMsg = wp.i18n.__( 'Caution: These themes may be active on other sites in the network. Are you sure you want to proceed?' ); 2059 2060 if ( 'plugin' === type ) { 2061 bulkDeleteMsg = wp.i18n.__( 'Are you sure you want to delete the selected plugins and their data?' ); 2062 } 2063 2064 if ( ! window.confirm( bulkDeleteMsg ) ) { 2010 2065 event.preventDefault(); 2011 2066 return; 2012 2067 } … … 2143 2198 .append( $( '<a />', { 2144 2199 'class': 'current', 2145 2200 'href': searchLocation, 2146 'text': wp. updates.l10n.searchResultsLabel2201 'text': wp.i18n.__( 'Search Results' ) 2147 2202 } ) ); 2148 2203 2149 2204 $( '.wp-filter .filter-links .current' ) … … 2166 2221 delete wp.updates.searchRequest; 2167 2222 2168 2223 if ( 0 === response.count ) { 2169 wp.a11y.speak( wp. updates.l10n.noPluginsFound);2224 wp.a11y.speak( wp.i18n.__( 'No plugins found. Try a different search.' ) ); 2170 2225 } else { 2171 wp.a11y.speak( wp. updates.l10n.pluginsFound.replace( '%d', response.count ) );2226 wp.a11y.speak( wp.i18n._n( '%d plugin found', '%d plugins found', response.count ) ); 2172 2227 } 2173 2228 } ); 2174 2229 }, 500 ) ); … … 2215 2270 wp.updates.searchRequest = wp.ajax.post( 'search-plugins', data ).done( function( response ) { 2216 2271 2217 2272 // Can we just ditch this whole subtitle business? 2218 var $subTitle = $( '<span />' ).addClass( 'subtitle' ).html( wp.updates.l10n.searchResults.replace( '%s', _.escape( data.s ) ) ), 2273 /* translators: %s: Search string */ 2274 var $subTitle = $( '<span />' ).addClass( 'subtitle' ).html( wp.i18n.__( 'Search results for “%s”' ).replace( '%s', _.escape( data.s ) ) ), 2219 2275 $oldSubTitle = $( '.wrap .subtitle' ); 2220 2276 2221 2277 if ( ! data.s.length ) { … … 2231 2287 delete wp.updates.searchRequest; 2232 2288 2233 2289 if ( 0 === response.count ) { 2234 wp.a11y.speak( wp. updates.l10n.noPluginsFound);2290 wp.a11y.speak( wp.i18n.__( 'No plugins found. Try a different search.' ) ); 2235 2291 } else { 2236 wp.a11y.speak( wp. updates.l10n.pluginsFound.replace( '%d', response.count ) );2292 wp.a11y.speak( wp.i18n._n( '%d plugin found', '%d plugins found', response.count ) ); 2237 2293 } 2238 2294 } ); 2239 2295 }, 500 ) ); -
src/wp-admin/js/user-profile.js
diff --git src/wp-admin/js/user-profile.js src/wp-admin/js/user-profile.js index 650fbd5..feb054a 100644
1 /* global ajaxurl , pwsL10n, userProfileL10n*/1 /* global ajaxurl */ 2 2 (function($) { 3 3 var updateLock = false, 4 4 … … 50 50 } 51 51 52 52 // Once zxcvbn loads, passwords strength is known. 53 $( '#pw-weak-text-label' ).html( userProfileL10n.warnWeak);53 $( '#pw-weak-text-label' ).html( wp.i18n.__( 'Confirm use of weak password' ) ); 54 54 } 55 55 56 56 function bindPass1() { … … 100 100 $toggleButton 101 101 .data( 'toggle', 0 ) 102 102 .attr({ 103 'aria-label': userProfileL10n.ariaHide103 'aria-label': wp.i18n.esc_attr__( 'Hide password' ) 104 104 }) 105 105 .find( '.text' ) 106 .text( userProfileL10n.hide)106 .text( wp.i18n.__( 'Hide' ) ) 107 107 .end() 108 108 .find( '.dashicons' ) 109 109 .removeClass( 'dashicons-visibility' ) … … 130 130 $toggleButton 131 131 .data( 'toggle', 1 ) 132 132 .attr({ 133 'aria-label': userProfileL10n.ariaShow133 'aria-label': wp.i18n.esc_attr__( 'Show password' ) 134 134 }) 135 135 .find( '.text' ) 136 .text( userProfileL10n.show)136 .text( wp.i18n.__( 'Show' ) ) 137 137 .end() 138 138 .find( '.dashicons' ) 139 139 .removeClass('dashicons-hidden') … … 290 290 291 291 switch ( strength ) { 292 292 case -1: 293 $( '#pass-strength-result' ).addClass( 'bad' ).html( pwsL10n.unknown);293 $( '#pass-strength-result' ).addClass( 'bad' ).html( wp.i18n._x( 'Password strength unknown', 'password strength' ) ); 294 294 break; 295 295 case 2: 296 $('#pass-strength-result').addClass('bad').html( pwsL10n.bad);296 $('#pass-strength-result').addClass('bad').html( wp.i18n._x( 'Weak', 'password strength' ) ); 297 297 break; 298 298 case 3: 299 $('#pass-strength-result').addClass('good').html( pwsL10n.good);299 $('#pass-strength-result').addClass('good').html( wp.i18n._x( 'Medium', 'password strength' ) ); 300 300 break; 301 301 case 4: 302 $('#pass-strength-result').addClass('strong').html( pwsL10n.strong);302 $('#pass-strength-result').addClass('strong').html( wp.i18n._x( 'Strong', 'password strength' ) ); 303 303 break; 304 304 case 5: 305 $('#pass-strength-result').addClass('short').html( pwsL10n.mismatch);305 $('#pass-strength-result').addClass('short').html( wp.i18n._x( 'Mismatch', 'password mismatch' ) ); 306 306 break; 307 307 default: 308 $('#pass-strength-result').addClass('short').html( pwsL10n['short']);308 $('#pass-strength-result').addClass('short').html( wp.i18n._x( 'Very weak', 'password strength' ) ); 309 309 } 310 310 } 311 311 … … 448 448 /* Warn the user if password was generated but not saved */ 449 449 $( window ).on( 'beforeunload', function () { 450 450 if ( true === updateLock ) { 451 return userProfileL10n.warn;451 return wp.i18n.__( 'Your new password has not been saved.' ); 452 452 } 453 453 } ); 454 454 -
src/wp-admin/js/word-count.js
diff --git src/wp-admin/js/word-count.js src/wp-admin/js/word-count.js index 89afdcc..9f8790b 100644
37 37 * @param {RegExp} settings.shortcodesRegExp Optional. Regular expression to find shortcodes. 38 38 * @param {Object} settings.l10n Optional. Localization object containing specific 39 39 * configuration for the current localization. 40 * @param {String} settings.l10n.type Optional. Method of finding words to count.41 40 * @param {Array} settings.l10n.shortcodes Optional. Array of shortcodes that should be removed 42 41 * from the text. 43 42 * … … 136 135 * \u2028 = line separator 137 136 * \u2029 = paragraph separator 138 137 */ 139 characters_including_spacesRegExp: /[^\f\n\r\t\v\u00AD\u2028\u2029]/g, 140 l10n: window.wordCountL10n || {} 138 characters_including_spacesRegExp: /[^\f\n\r\t\v\u00AD\u2028\u2029]/g 141 139 }; 142 140 143 141 /** … … 157 155 var count = 0; 158 156 159 157 // Use default type if none was provided. 160 type = type || this.settings.l10n.type; 158 159 /* 160 * translators: If your word count is based on single characters (e.g. East Asian characters), 161 * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'. 162 * Do not translate into your own language. 163 */ 164 type = type || wp.i18n._x( 'words', 'Word count type. Do not translate!' ); 161 165 162 166 // Sanitize type to one of three possibilities: 'words', 'characters_excluding_spaces' or 'characters_including_spaces'. 163 167 if ( type !== 'characters_excluding_spaces' && type !== 'characters_including_spaces' ) { -
src/wp-admin/theme-install.php
diff --git src/wp-admin/theme-install.php src/wp-admin/theme-install.php index 6b38465..f2f8508 100644
wp_localize_script( 'theme', '_wpThemeSettings', array( 42 42 'installURI' => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null, 43 43 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ) 44 44 ), 45 'l10n' => array(46 'addNew' => __( 'Add New Theme' ),47 'search' => __( 'Search Themes' ),48 'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis)49 'upload' => __( 'Upload Theme' ),50 'back' => __( 'Back' ),51 'error' => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ),52 'themesFound' => __( 'Number of Themes found: %d' ),53 'noThemesFound' => __( 'No themes found. Try a different search.' ),54 'collapseSidebar' => __( 'Collapse Sidebar' ),55 'expandSidebar' => __( 'Expand Sidebar' ),56 ),57 45 'installedThemes' => array_keys( $installed_themes ), 58 46 ) ); 59 47 -
src/wp-includes/class-wp-customize-widgets.php
diff --git src/wp-includes/class-wp-customize-widgets.php src/wp-includes/class-wp-customize-widgets.php index 16549ff..aae92d8 100644
final class WP_Customize_Widgets { 722 722 'registeredWidgets' => $wp_registered_widgets, 723 723 'availableWidgets' => $available_widgets, // @todo Merge this with registered_widgets 724 724 'l10n' => array( 725 'saveBtnLabel' => __( 'Apply' ),726 'saveBtnTooltip' => __( 'Save and preview changes before publishing them.' ),727 'removeBtnLabel' => __( 'Remove' ),728 'removeBtnTooltip' => __( 'Trash widget by moving it to the inactive widgets sidebar.' ),729 'error' => __( 'An error has occurred. Please reload the page and try again.' ),730 'widgetMovedUp' => __( 'Widget moved up' ),731 'widgetMovedDown' => __( 'Widget moved down' ),732 'noAreasRendered' => __( 'There are no widget areas currently rendered in the preview. Navigate in the preview to a template that makes use of a widget area in order to access its widgets here.' ),733 'reorderModeOn' => __( 'Reorder mode enabled' ),734 'reorderModeOff' => __( 'Reorder mode closed' ),735 725 'reorderLabelOn' => esc_attr__( 'Reorder widgets' ), 736 726 'reorderLabelOff' => esc_attr__( 'Close reorder mode' ), 737 727 ), -
src/wp-includes/js/media-audiovideo.js
diff --git src/wp-includes/js/media-audiovideo.js src/wp-includes/js/media-audiovideo.js index e37a221..7fdf7bf 100644
1 1 (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ 2 2 var media = wp.media, 3 baseSettings = window._wpmejsSettings || {}, 4 l10n = window._wpMediaViewsL10n || {}; 3 baseSettings = window._wpmejsSettings || {}; 5 4 6 5 /** 7 6 * @mixin … … wp.media.mixin = { 79 78 */ 80 79 wp.media.playlist = new wp.media.collection({ 81 80 tag: 'playlist', 82 editTitle : l10n.editPlaylistTitle,81 editTitle : wp.i18n.__( 'Edit Audio Playlist' ), 83 82 defaults : { 84 83 id: wp.media.view.settings.post.id, 85 84 style: 'light', … … media.view.VideoDetails = require( './views/video-details.js' ); 226 225 * @augments Backbone.Model 227 226 */ 228 227 var State = wp.media.controller.State, 229 l10n = wp.media.view.l10n,230 228 AudioDetails; 231 229 232 230 AudioDetails = State.extend({ 233 231 defaults: { 234 232 id: 'audio-details', 235 233 toolbar: 'audio-details', 236 title: l10n.audioDetailsTitle,234 title: wp.i18n.__( 'Cancel Edit' ), 237 235 content: 'audio-details', 238 236 menu: 'audio-details', 239 237 router: false, … … module.exports = AudioDetails; 259 257 * @augments Backbone.Model 260 258 */ 261 259 var State = wp.media.controller.State, 262 l10n = wp.media.view.l10n,263 260 VideoDetails; 264 261 265 262 VideoDetails = State.extend({ 266 263 defaults: { 267 264 id: 'video-details', 268 265 toolbar: 'video-details', 269 title: l10n.videoDetailsTitle,266 title: wp.i18n.__( 'Video Details' ), 270 267 content: 'video-details', 271 268 menu: 'video-details', 272 269 router: false, … … AudioDetails = MediaDetails.extend({ 389 386 content: 'audio-details', 390 387 toolbar: 'audio-details', 391 388 type: 'link', 392 title: l10n.audioDetailsTitle,389 title: wp.i18n.__( 'Audio Details' ), 393 390 priority: 120 394 391 }, 395 392 396 393 initialize: function( options ) { 397 394 options.DetailsView = wp.media.view.AudioDetails; 398 options.cancelText = l10n.audioDetailsCancel;399 options.addText = l10n.audioAddSourceTitle;395 options.cancelText = wp.i18n.__( 'Cancel Edit' ); 396 options.addText = wp.i18n.__( 'Add Audio Source' ); 400 397 401 398 MediaDetails.prototype.initialize.call( this, options ); 402 399 }, … … AudioDetails = MediaDetails.extend({ 417 414 new MediaLibrary( { 418 415 type: 'audio', 419 416 id: 'replace-audio', 420 title: l10n.audioReplaceTitle,417 title: wp.i18n.__( 'Replace Audio' ), 421 418 toolbar: 'replace-audio', 422 419 media: this.media, 423 420 menu: 'audio-details' … … AudioDetails = MediaDetails.extend({ 426 423 new MediaLibrary( { 427 424 type: 'audio', 428 425 id: 'add-audio-source', 429 title: l10n.audioAddSourceTitle,426 title: wp.i18n.__( 'Add Audio Source' ), 430 427 toolbar: 'add-audio-source', 431 428 media: this.media, 432 429 menu: false … … MediaDetails = Select.extend({ 542 539 }, 543 540 544 541 renderDetailsToolbar: function() { 545 this.setPrimaryButton( l10n.update, function( controller, state ) {542 this.setPrimaryButton( wp.i18n.__( 'Update' ), function( controller, state ) { 546 543 controller.close(); 547 544 state.trigger( 'update', controller.media.toJSON() ); 548 545 } ); 549 546 }, 550 547 551 548 renderReplaceToolbar: function() { 552 this.setPrimaryButton( l10n.replace, function( controller, state ) {549 this.setPrimaryButton( wp.i18n.__( 'Replace' ), function( controller, state ) { 553 550 var attachment = state.get( 'selection' ).single(); 554 551 controller.media.changeAttachment( attachment ); 555 552 state.trigger( 'replace', controller.media.toJSON() ); … … VideoDetails = MediaDetails.extend({ 594 591 content: 'video-details', 595 592 toolbar: 'video-details', 596 593 type: 'link', 597 title: l10n.videoDetailsTitle,594 title: wp.i18n.__( 'Video Details' ), 598 595 priority: 120 599 596 }, 600 597 601 598 initialize: function( options ) { 602 599 options.DetailsView = wp.media.view.VideoDetails; 603 options.cancelText = l10n.videoDetailsCancel;604 options.addText = l10n.videoAddSourceTitle;600 options.cancelText = wp.i18n.__( 'Cancel Edit' ); 601 options.addText = wp.i18n.__( 'Add Video Source' ); 605 602 606 603 MediaDetails.prototype.initialize.call( this, options ); 607 604 }, … … VideoDetails = MediaDetails.extend({ 624 621 new MediaLibrary( { 625 622 type: 'video', 626 623 id: 'replace-video', 627 title: l10n.videoReplaceTitle,624 title: wp.i18n.__( 'Replace Video' ), 628 625 toolbar: 'replace-video', 629 626 media: this.media, 630 627 menu: 'video-details' … … VideoDetails = MediaDetails.extend({ 633 630 new MediaLibrary( { 634 631 type: 'video', 635 632 id: 'add-video-source', 636 title: l10n.videoAddSourceTitle,633 title: wp.i18n.__( 'Add Video Source' ), 637 634 toolbar: 'add-video-source', 638 635 media: this.media, 639 636 menu: false … … VideoDetails = MediaDetails.extend({ 642 639 new MediaLibrary( { 643 640 type: 'image', 644 641 id: 'select-poster-image', 645 title: l10n.videoSelectPosterImageTitle,642 title: wp.i18n.__( 'Select Poster Image' ), 646 643 toolbar: 'select-poster-image', 647 644 media: this.media, 648 645 menu: 'video-details' … … VideoDetails = MediaDetails.extend({ 651 648 new MediaLibrary( { 652 649 type: 'text', 653 650 id: 'add-track', 654 title: l10n.videoAddTrackTitle,651 title: wp.i18n.__( 'Add Subtitles' ), 655 652 toolbar: 'add-track', 656 653 media: this.media, 657 654 menu: 'video-details' … … VideoDetails = MediaDetails.extend({ 660 657 }, 661 658 662 659 renderSelectPosterImageToolbar: function() { 663 this.setPrimaryButton( l10n.videoSelectPosterImageTitle, function( controller, state ) {660 this.setPrimaryButton( wp.i18n.__( 'Select Poster Image' ), function( controller, state ) { 664 661 var urls = [], attachment = state.get( 'selection' ).single(); 665 662 666 663 controller.media.set( 'poster', attachment.get( 'url' ) ); … … VideoDetails = MediaDetails.extend({ 682 679 }, 683 680 684 681 renderAddTrackToolbar: function() { 685 this.setPrimaryButton( l10n.videoAddTrackTitle, function( controller, state ) {682 this.setPrimaryButton( wp.i18n.__( 'Add Subtitles' ), function( controller, state ) { 686 683 var attachment = state.get( 'selection' ).single(), 687 684 content = controller.media.get( 'content' ); 688 685 -
src/wp-includes/js/media-editor.js
diff --git src/wp-includes/js/media-editor.js src/wp-includes/js/media-editor.js index aa40746..c4e85a1 100644
663 663 _wpnonce: settings.post.nonce 664 664 }).done( function( html ) { 665 665 if ( html == '0' ) { 666 window.alert( w indow.setPostThumbnailL10n.error);666 window.alert( wp.i18n.__( 'Could not set that as the thumbnail image. Try a different attachment.' ) ); 667 667 return; 668 668 } 669 669 $( '.inside', '#postimagediv' ).html( html ); -
src/wp-includes/js/media-grid.js
diff --git src/wp-includes/js/media-grid.js src/wp-includes/js/media-grid.js index 5d0faa2..b5d092a 100644
8 8 * @augments wp.media.controller.State 9 9 * @augments Backbone.Model 10 10 */ 11 var l10n = wp.media.view.l10n, 12 EditAttachmentMetadata; 13 14 EditAttachmentMetadata = wp.media.controller.State.extend({ 11 var EditAttachmentMetadata = wp.media.controller.State.extend({ 15 12 defaults: { 16 13 id: 'edit-attachment', 17 14 // Title string passed to the frame's title region view. 18 title: l10n.attachmentDetails,15 title: wp.i18n.__( 'Attachment Details' ), 19 16 // Region mode defaults. 20 17 content: 'edit-metadata', 21 18 menu: false, … … module.exports = DeleteSelectedPermanently; 190 187 * @augments Backbone.View 191 188 */ 192 189 var Button = wp.media.view.Button, 193 l10n = wp.media.view.l10n,194 190 DeleteSelected; 195 191 196 192 DeleteSelected = Button.extend({ … … DeleteSelected = Button.extend({ 204 200 205 201 filterChange: function( model ) { 206 202 if ( 'trash' === model.get( 'status' ) ) { 207 this.model.set( 'text', l10n.untrashSelected);203 this.model.set( 'text', wp.i18n.__( 'Untrash Selected' ) ); 208 204 } else if ( wp.media.view.settings.mediaTrash ) { 209 this.model.set( 'text', l10n.trashSelected);205 this.model.set( 'text', wp.i18n.__( 'Trash Selected' ) ); 210 206 } else { 211 this.model.set( 'text', l10n.deleteSelected);207 this.model.set( 'text', wp.i18n.__( 'Delete Selected' ) ); 212 208 } 213 209 }, 214 210 … … module.exports = DeleteSelected; 241 237 * @augments Backbone.View 242 238 */ 243 239 var Button = wp.media.view.Button, 244 l10n = wp.media.view.l10n,245 240 SelectModeToggle; 246 241 247 242 SelectModeToggle = Button.extend({ … … SelectModeToggle = Button.extend({ 283 278 if ( this.controller.isModeActive( 'select' ) ) { 284 279 this.model.set( { 285 280 size: 'large', 286 text: l10n.cancelSelection281 text: wp.i18n.__( 'Cancel Selection' ) 287 282 } ); 288 283 children.not( '.spinner, .media-button' ).hide(); 289 284 this.$el.show(); … … SelectModeToggle = Button.extend({ 291 286 } else { 292 287 this.model.set( { 293 288 size: '', 294 text: l10n.bulkSelect289 text: wp.i18n.__( 'Bulk Select' ) 295 290 } ); 296 291 this.controller.content.get().$el.removeClass( 'fixed' ); 297 292 toolbar.$el.css( 'width', '' ); -
src/wp-includes/js/media-views.js
diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js index e8a8202..418cbce 100644
module.exports = CollectionAdd; 136 136 * @param {string} attributes.collectionType The collection type. (e.g. 'playlist'). 137 137 */ 138 138 var Library = wp.media.controller.Library, 139 l10n = wp.media.view.l10n,140 139 $ = jQuery, 141 140 CollectionEdit; 142 141 … … CollectionEdit = Library.extend({ 249 248 250 249 // Add the 'Reverse order' button to the toolbar. 251 250 attachmentsBrowserView.toolbar.set( 'reverse', { 252 text: l10n.reverseOrder,251 text: wp.i18n.__( 'Reverse order' ), 253 252 priority: 80, 254 253 255 254 click: function() { … … module.exports = CollectionEdit; 271 270 * @augments wp.media.controller.State 272 271 * @augments Backbone.Model 273 272 */ 274 var l10n = wp.media.view.l10n, 275 Cropper; 276 277 Cropper = wp.media.controller.State.extend({ 273 var Cropper = wp.media.controller.State.extend({ 278 274 defaults: { 279 275 id: 'cropper', 280 title: l10n.cropImage,276 title: wp.i18n.__( 'Crop Image' ), 281 277 // Region mode defaults. 282 278 toolbar: 'crop', 283 279 content: 'crop', … … Cropper = wp.media.controller.State.extend({ 323 319 items: { 324 320 insert: { 325 321 style: 'primary', 326 text: l10n.cropImage,322 text: wp.i18n.__( 'Crop Image' ), 327 323 priority: 80, 328 324 requires: { library: false, selection: false }, 329 325 … … Cropper = wp.media.controller.State.extend({ 334 330 selection = controller.state().get('selection').first(); 335 331 selection.set({cropDetails: controller.state().imgSelect.getSelection()}); 336 332 337 this.$el.text( l10n.cropping);333 this.$el.text( wp.i18n.__( 'Cropping…' ) ); 338 334 this.$el.attr('disabled', true); 339 335 340 336 controller.state().doCrop( selection ).done( function( croppedImage ) { … … Cropper = wp.media.controller.State.extend({ 352 348 _.extend( toolbarOptions.items, { 353 349 skip: { 354 350 style: 'secondary', 355 text: l10n.skipCropping,351 text: wp.i18n.__( 'Skip Cropping' ), 356 352 priority: 70, 357 353 requires: { library: false, selection: false }, 358 354 click: function() { … … module.exports = CustomizeImageCropper; 445 441 * @param {string} [attributes.menu=false] Initial mode for the menu region. 446 442 * @param {string} [attributes.url] Unused. @todo Consider removal. 447 443 */ 448 var l10n = wp.media.view.l10n, 449 EditImage; 450 451 EditImage = wp.media.controller.State.extend({ 444 var EditImage = wp.media.controller.State.extend({ 452 445 defaults: { 453 446 id: 'edit-image', 454 title: l10n.editImage,447 title: wp.i18n.__( 'Edit Image' ), 455 448 menu: false, 456 449 toolbar: 'edit-image', 457 450 content: 'edit-image', … … EditImage = wp.media.controller.State.extend({ 485 478 items: { 486 479 back: { 487 480 style: 'primary', 488 text: l10n.back,481 text: wp.i18n.__( 'Back' ), 489 482 priority: 20, 490 483 click: function() { 491 484 if ( previous ) { … … module.exports = EditImage; 524 517 * @param {string} [attributes.url] The embed URL. 525 518 * @param {object} [attributes.metadata={}] Properties of the embed, which will override attributes.url if set. 526 519 */ 527 var l10n = wp.media.view.l10n, 528 $ = Backbone.$, 520 var $ = Backbone.$, 529 521 Embed; 530 522 531 523 Embed = wp.media.controller.State.extend({ 532 524 defaults: { 533 525 id: 'embed', 534 title: l10n.insertFromUrlTitle,526 title: wp.i18n.__( 'Insert from URL' ), 535 527 content: 'embed', 536 528 menu: 'default', 537 529 toolbar: 'main-embed', … … module.exports = FeaturedImage; 794 786 */ 795 787 var Selection = wp.media.model.Selection, 796 788 Library = wp.media.controller.Library, 797 l10n = wp.media.view.l10n,798 789 GalleryAdd; 799 790 800 791 GalleryAdd = Library.extend({ 801 792 defaults: _.defaults({ 802 793 id: 'gallery-library', 803 title: l10n.addToGalleryTitle,794 title: wp.i18n.__( 'Add to Gallery' ), 804 795 multiple: 'add', 805 796 filterable: 'uploaded', 806 797 menu: 'gallery', … … module.exports = GalleryAdd; 885 876 * If none supplied, defaults to wp.media.view.Attachment.EditLibrary. 886 877 */ 887 878 var Library = wp.media.controller.Library, 888 l10n = wp.media.view.l10n,889 879 GalleryEdit; 890 880 891 881 GalleryEdit = Library.extend({ 892 882 defaults: { 893 883 id: 'gallery-edit', 894 title: l10n.editGalleryTitle,884 title: wp.i18n.__( 'Edit Gallery' ), 895 885 multiple: false, 896 886 searchable: false, 897 887 sortable: true, … … GalleryEdit = Library.extend({ 981 971 }); 982 972 983 973 browser.toolbar.set( 'reverse', { 984 text: l10n.reverseOrder,974 text: wp.i18n.__( 'Reverse order' ), 985 975 priority: 80, 986 976 987 977 click: function() { … … module.exports = GalleryEdit; 1020 1010 */ 1021 1011 var State = wp.media.controller.State, 1022 1012 Library = wp.media.controller.Library, 1023 l10n = wp.media.view.l10n,1024 1013 ImageDetails; 1025 1014 1026 1015 ImageDetails = State.extend({ 1027 1016 defaults: _.defaults({ 1028 1017 id: 'image-details', 1029 title: l10n.imageDetailsTitle,1018 title: wp.i18n.__( 'Image Details' ), 1030 1019 content: 'image-details', 1031 1020 menu: false, 1032 1021 router: false, … … module.exports = ImageDetails; 1090 1079 * @param {boolean} [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user. 1091 1080 * @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state. 1092 1081 */ 1093 var l10n = wp.media.view.l10n, 1094 getUserSetting = window.getUserSetting, 1082 var getUserSetting = window.getUserSetting, 1095 1083 setUserSetting = window.setUserSetting, 1096 1084 Library; 1097 1085 1098 1086 Library = wp.media.controller.State.extend({ 1099 1087 defaults: { 1100 1088 id: 'library', 1101 title: l10n.mediaLibraryTitle,1089 title: wp.i18n.__( 'Media Library' ), 1102 1090 multiple: false, 1103 1091 content: 'upload', 1104 1092 menu: 'default', … … module.exports = Region; 1610 1598 * @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state. 1611 1599 */ 1612 1600 var Library = wp.media.controller.Library, 1613 l10n = wp.media.view.l10n,1614 1601 ReplaceImage; 1615 1602 1616 1603 ReplaceImage = Library.extend({ 1617 1604 defaults: _.defaults({ 1618 1605 id: 'replace-image', 1619 title: l10n.replaceImageTitle,1606 title: wp.i18n.__( 'Replace Image' ), 1620 1607 multiple: false, 1621 1608 filterable: 'uploaded', 1622 1609 toolbar: 'replace', … … All = wp.media.view.AttachmentFilters.extend({ 2509 2496 }); 2510 2497 2511 2498 filters.all = { 2512 text: l10n.allMediaItems,2499 text: wp.i18n.__( 'All media items' ), 2513 2500 props: { 2514 2501 status: null, 2515 2502 type: null, … … All = wp.media.view.AttachmentFilters.extend({ 2535 2522 } 2536 2523 2537 2524 filters.unattached = { 2538 text: l10n.unattached,2525 text: wp.i18n.__( 'Unattached' ), 2539 2526 props: { 2540 2527 status: null, 2541 2528 uploadedTo: 0, … … All = wp.media.view.AttachmentFilters.extend({ 2550 2537 this.controller.isModeActive( 'grid' ) ) { 2551 2538 2552 2539 filters.trash = { 2553 text: l10n.trash,2540 text: wp.i18n._x( 'Trash', 'noun' ), 2554 2541 props: { 2555 2542 uploadedTo: null, 2556 2543 status: 'trash', … … module.exports = All; 2578 2565 * @augments wp.Backbone.View 2579 2566 * @augments Backbone.View 2580 2567 */ 2581 var l10n = wp.media.view.l10n, 2582 DateFilter; 2583 2584 DateFilter = wp.media.view.AttachmentFilters.extend({ 2568 var DateFilter = wp.media.view.AttachmentFilters.extend({ 2585 2569 id: 'media-attachment-date-filters', 2586 2570 2587 2571 createFilters: function() { … … DateFilter = wp.media.view.AttachmentFilters.extend({ 2596 2580 }; 2597 2581 }); 2598 2582 filters.all = { 2599 text: l10n.allDates,2583 text: wp.i18n.__( 'All dates' ), 2600 2584 props: { 2601 2585 monthnum: false, 2602 2586 year: false … … Uploaded = wp.media.view.AttachmentFilters.extend({ 2634 2618 2635 2619 this.filters = { 2636 2620 all: { 2637 text: text || l10n.allMediaItems,2621 text: text || wp.i18n.__( 'All media items' ), 2638 2622 props: { 2639 2623 uploadedTo: null, 2640 2624 orderby: 'date', … … Uploaded = wp.media.view.AttachmentFilters.extend({ 2654 2638 }, 2655 2639 2656 2640 unattached: { 2657 text: l10n.unattached,2641 text: wp.i18n.__( 'Unattached' ), 2658 2642 props: { 2659 2643 uploadedTo: 0, 2660 2644 orderby: 'menuOrder', … … module.exports = Attachment; 3225 3209 * @augments Backbone.View 3226 3210 */ 3227 3211 var Attachment = wp.media.view.Attachment, 3228 l10n = wp.media.view.l10n,3229 3212 Details; 3230 3213 3231 3214 Details = Attachment.extend({ … … Details = Attachment.extend({ 3280 3263 deleteAttachment: function( event ) { 3281 3264 event.preventDefault(); 3282 3265 3283 if ( window.confirm( l10n.warnDelete) ) {3266 if ( window.confirm( wp.i18n.__( "You are about to permanently delete this item.\n 'Cancel' to stop, 'OK' to delete." ) ) ) { 3284 3267 this.model.destroy(); 3285 3268 // Keep focus inside media modal 3286 3269 // after image is deleted … … module.exports = Attachments; 3751 3734 */ 3752 3735 var View = wp.media.View, 3753 3736 mediaTrash = wp.media.view.settings.mediaTrash, 3754 l10n = wp.media.view.l10n,3755 3737 $ = jQuery, 3756 3738 AttachmentsBrowser; 3757 3739 … … AttachmentsBrowser = View.extend({ 3829 3811 // "Filters" will return a <select>, need to render 3830 3812 // screen reader text before 3831 3813 this.toolbar.set( 'filtersLabel', new wp.media.view.Label({ 3832 value: l10n.filterByType,3814 value: wp.i18n.__( 'Filter by type' ), 3833 3815 attributes: { 3834 3816 'for': 'media-attachment-filters' 3835 3817 }, … … AttachmentsBrowser = View.extend({ 3869 3851 3870 3852 // DateFilter is a <select>, screen reader text needs to be rendered before 3871 3853 this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({ 3872 value: l10n.filterByDate,3854 value: wp.i18n.__( 'Filter by date' ), 3873 3855 attributes: { 3874 3856 'for': 'media-attachment-date-filters' 3875 3857 }, … … AttachmentsBrowser = View.extend({ 3883 3865 3884 3866 // BulkSelection is a <div> with subviews, including screen reader text 3885 3867 this.toolbar.set( 'selectModeToggleButton', new wp.media.view.SelectModeToggleButton({ 3886 text: l10n.bulkSelect,3868 text: wp.i18n.__( 'Bulk Select' ), 3887 3869 controller: this.controller, 3888 3870 priority: -70 3889 3871 }).render() ); … … AttachmentsBrowser = View.extend({ 3892 3874 filters: Filters, 3893 3875 style: 'primary', 3894 3876 disabled: true, 3895 text: mediaTrash ? l10n.trashSelected : l10n.deleteSelected,3877 text: mediaTrash ? wp.i18n.__( 'Trash Selected' ) : wp.i18n.__( 'Delete Selected' ), 3896 3878 controller: this.controller, 3897 3879 priority: -60, 3898 3880 click: function() { … … AttachmentsBrowser = View.extend({ 3904 3886 return; 3905 3887 } 3906 3888 3907 if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete) ) {3889 if ( ! mediaTrash && ! window.confirm( wp.i18n.__( "You are about to permanently delete these items.\n 'Cancel' to stop, 'OK' to delete." ) ) ) { 3908 3890 return; 3909 3891 } 3910 3892 3911 3893 if ( mediaTrash && 3912 3894 'trash' !== selection.at( 0 ).get( 'status' ) && 3913 ! window.confirm( l10n.warnBulkTrash) ) {3895 ! window.confirm( wp.i18n.__( "You are about to trash these items.\n 'Cancel' to stop, 'OK' to delete." ) ) ) { 3914 3896 3915 3897 return; 3916 3898 } … … AttachmentsBrowser = View.extend({ 3952 3934 filters: Filters, 3953 3935 style: 'primary', 3954 3936 disabled: true, 3955 text: l10n.deleteSelected,3937 text: wp.i18n.__( 'Delete Selected' ), 3956 3938 controller: this.controller, 3957 3939 priority: -55, 3958 3940 click: function() { 3959 3941 var removed = [], selection = this.controller.state().get( 'selection' ); 3960 3942 3961 if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete) ) {3943 if ( ! selection.length || ! window.confirm( wp.i18n.__( "You are about to permanently delete these items.\n 'Cancel' to stop, 'OK' to delete." ) ) ) { 3962 3944 return; 3963 3945 } 3964 3946 … … AttachmentsBrowser = View.extend({ 3980 3962 } else if ( this.options.date ) { 3981 3963 // DateFilter is a <select>, screen reader text needs to be rendered before 3982 3964 this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({ 3983 value: l10n.filterByDate,3965 value: wp.i18n.__( 'Filter by date' ), 3984 3966 attributes: { 3985 3967 'for': 'media-attachment-date-filters' 3986 3968 }, … … AttachmentsBrowser = View.extend({ 3996 3978 if ( this.options.search ) { 3997 3979 // Search is an input, screen reader text needs to be rendered before 3998 3980 this.toolbar.set( 'searchLabel', new wp.media.view.Label({ 3999 value: l10n.searchMediaLabel,3981 value: wp.i18n.__( 'Search Media' ), 4000 3982 attributes: { 4001 3983 'for': 'media-search-input' 4002 3984 }, … … AttachmentsBrowser = View.extend({ 4011 3993 4012 3994 if ( this.options.dragInfo ) { 4013 3995 this.toolbar.set( 'dragInfo', new View({ 4014 el: $( '<div class="instructions">' + l10n.dragInfo+ '</div>' )[0],3996 el: $( '<div class="instructions">' + wp.i18n.__( 'Drag and drop to reorder media files.' ) + '</div>' )[0], 4015 3997 priority: -40 4016 3998 }) ); 4017 3999 } 4018 4000 4019 4001 if ( this.options.suggestedWidth && this.options.suggestedHeight ) { 4020 4002 this.toolbar.set( 'suggestedDimensions', new View({ 4021 el: $( '<div class="instructions">' + l10n.suggestedDimensions+ ' ' + this.options.suggestedWidth + ' × ' + this.options.suggestedHeight + '</div>' )[0],4003 el: $( '<div class="instructions">' + wp.i18n.__( 'Suggested image dimensions:' ) + ' ' + this.options.suggestedWidth + ' × ' + this.options.suggestedHeight + '</div>' )[0], 4022 4004 priority: -40 4023 4005 }) ); 4024 4006 } … … AttachmentsBrowser = View.extend({ 4054 4036 this.uploader = new wp.media.view.UploaderInline({ 4055 4037 controller: this.controller, 4056 4038 status: false, 4057 message: this.controller.isModeActive( 'grid' ) ? '' : l10n.noItemsFound,4039 message: this.controller.isModeActive( 'grid' ) ? '' : wp.i18n.__( 'No items found.' ), 4058 4040 canClose: this.controller.isModeActive( 'grid' ) 4059 4041 }); 4060 4042 … … AttachmentsBrowser = View.extend({ 4098 4080 }); 4099 4081 4100 4082 this.attachmentsNoResults.$el.addClass( 'hidden no-media' ); 4101 this.attachmentsNoResults.$el.html( l10n.noMedia);4083 this.attachmentsNoResults.$el.html( wp.i18n.__( 'No media files found.' ) ); 4102 4084 4103 4085 this.views.add( this.attachmentsNoResults ); 4104 4086 } … … module.exports = Button; 4351 4333 */ 4352 4334 var View = wp.media.View, 4353 4335 UploaderStatus = wp.media.view.UploaderStatus, 4354 l10n = wp.media.view.l10n,4355 4336 $ = jQuery, 4356 4337 Cropper; 4357 4338 … … Cropper = View.extend({ 4375 4356 }, 4376 4357 prepare: function() { 4377 4358 return { 4378 title: l10n.cropYourImage,4359 title: wp.i18n.__( 'Crop your image' ), 4379 4360 url: this.options.attachment.get('url') 4380 4361 }; 4381 4362 }, … … Cropper = View.extend({ 4394 4375 4395 4376 this.views.add( '.upload-errors', new wp.media.view.UploaderStatusError({ 4396 4377 filename: UploaderStatus.prototype.filename(filename), 4397 message: w indow._wpMediaViewsL10n.cropError4378 message: wp.i18n.__( 'There has been an error cropping your image.' ) 4398 4379 }), { at: 0 }); 4399 4380 } 4400 4381 }); … … module.exports = Frame; 4951 4932 * @mixes wp.media.controller.StateMachine 4952 4933 */ 4953 4934 var Select = wp.media.view.MediaFrame.Select, 4954 l10n = wp.media.view.l10n,4955 4935 ImageDetails; 4956 4936 4957 4937 ImageDetails = Select.extend({ … … ImageDetails = Select.extend({ 4962 4942 content: 'image-details', 4963 4943 toolbar: 'image-details', 4964 4944 type: 'link', 4965 title: l10n.imageDetailsTitle,4945 title: wp.i18n.__( 'Image Details' ), 4966 4946 priority: 120 4967 4947 }, 4968 4948 … … ImageDetails = Select.extend({ 4993 4973 library: wp.media.query( { type: 'image' } ), 4994 4974 image: this.image, 4995 4975 multiple: false, 4996 title: l10n.imageReplaceTitle,4976 title: wp.i18n.__( 'Replace Image' ), 4997 4977 toolbar: 'replace', 4998 4978 priority: 80, 4999 4979 displaySettings: true … … ImageDetails = Select.extend({ 5037 5017 items: { 5038 5018 select: { 5039 5019 style: 'primary', 5040 text: l10n.update,5020 text: wp.i18n.__( 'Update' ), 5041 5021 priority: 80, 5042 5022 5043 5023 click: function() { … … ImageDetails = Select.extend({ 5068 5048 controller: this, 5069 5049 items: { 5070 5050 back: { 5071 text: l10n.back,5051 text: wp.i18n.__( 'Back' ), 5072 5052 priority: 20, 5073 5053 click: function() { 5074 5054 if ( previous ) { … … ImageDetails = Select.extend({ 5081 5061 5082 5062 replace: { 5083 5063 style: 'primary', 5084 text: l10n.replace,5064 text: wp.i18n.__( 'Replace' ), 5085 5065 priority: 80, 5086 5066 5087 5067 click: function() { … … Post = Select.extend({ 5167 5147 // Main states. 5168 5148 new Library({ 5169 5149 id: 'insert', 5170 title: l10n.insertMediaTitle,5150 title: wp.i18n.__( 'Insert Media' ), 5171 5151 priority: 20, 5172 5152 toolbar: 'main-insert', 5173 5153 filterable: 'all', … … Post = Select.extend({ 5188 5168 5189 5169 new Library({ 5190 5170 id: 'gallery', 5191 title: l10n.createGalleryTitle,5171 title: wp.i18n.__( 'Create Gallery' ), 5192 5172 priority: 40, 5193 5173 toolbar: 'main-gallery', 5194 5174 filterable: 'uploaded', … … Post = Select.extend({ 5216 5196 5217 5197 new Library({ 5218 5198 id: 'playlist', 5219 title: l10n.createPlaylistTitle,5199 title: wp.i18n.__( 'Create Audio Playlist' ), 5220 5200 priority: 60, 5221 5201 toolbar: 'main-playlist', 5222 5202 filterable: 'uploaded', … … Post = Select.extend({ 5232 5212 new wp.media.controller.CollectionEdit({ 5233 5213 type: 'audio', 5234 5214 collectionType: 'playlist', 5235 title: l10n.editPlaylistTitle,5215 title: wp.i18n.__( 'Edit Audio Playlist' ), 5236 5216 SettingsView: wp.media.view.Settings.Playlist, 5237 5217 library: options.selection, 5238 5218 editing: options.editing, 5239 5219 menu: 'playlist', 5240 dragInfoText: l10n.playlistDragInfo,5220 dragInfoText: wp.i18n.__( 'Drag and drop to reorder tracks.' ), 5241 5221 dragInfo: false 5242 5222 }), 5243 5223 5244 5224 new wp.media.controller.CollectionAdd({ 5245 5225 type: 'audio', 5246 5226 collectionType: 'playlist', 5247 title: l10n.addToPlaylistTitle5227 title: wp.i18n.__( 'Add to Audio Playlist' ) 5248 5228 }), 5249 5229 5250 5230 new Library({ 5251 5231 id: 'video-playlist', 5252 title: l10n.createVideoPlaylistTitle,5232 title: wp.i18n.__( 'Create Video Playlist' ), 5253 5233 priority: 60, 5254 5234 toolbar: 'main-video-playlist', 5255 5235 filterable: 'uploaded', … … Post = Select.extend({ 5264 5244 new wp.media.controller.CollectionEdit({ 5265 5245 type: 'video', 5266 5246 collectionType: 'playlist', 5267 title: l10n.editVideoPlaylistTitle,5247 title: wp.i18n.__( 'Create Video Playlist' ), 5268 5248 SettingsView: wp.media.view.Settings.Playlist, 5269 5249 library: options.selection, 5270 5250 editing: options.editing, 5271 5251 menu: 'video-playlist', 5272 dragInfoText: l10n.videoPlaylistDragInfo,5252 dragInfoText: wp.i18n.__( 'Drag and drop to reorder videos.' ), 5273 5253 dragInfo: false 5274 5254 }), 5275 5255 5276 5256 new wp.media.controller.CollectionAdd({ 5277 5257 type: 'video', 5278 5258 collectionType: 'playlist', 5279 title: l10n.addToVideoPlaylistTitle5259 title: wp.i18n.__( 'Add to Video Playlist' ) 5280 5260 }) 5281 5261 ]); 5282 5262 … … Post = Select.extend({ 5393 5373 5394 5374 view.set({ 5395 5375 cancel: { 5396 text: l10n.cancelGalleryTitle,5376 text: wp.i18n.__( '← Cancel Gallery' ), 5397 5377 priority: 20, 5398 5378 click: function() { 5399 5379 if ( previous ) { … … Post = Select.extend({ 5421 5401 5422 5402 view.set({ 5423 5403 cancel: { 5424 text: l10n.cancelPlaylistTitle,5404 text: wp.i18n.__( '← Cancel Audio Playlist' ), 5425 5405 priority: 20, 5426 5406 click: function() { 5427 5407 if ( previous ) { … … Post = Select.extend({ 5445 5425 5446 5426 view.set({ 5447 5427 cancel: { 5448 text: l10n.cancelVideoPlaylistTitle,5428 text: wp.i18n.__( '← Cancel Video Playlist' ), 5449 5429 priority: 20, 5450 5430 click: function() { 5451 5431 if ( previous ) { … … Post = Select.extend({ 5495 5475 }).render(); 5496 5476 5497 5477 view.toolbar.set( 'backToLibrary', { 5498 text: l10n.returnToLibrary,5478 text: wp.i18n.__( '← Return to library' ), 5499 5479 priority: -100, 5500 5480 5501 5481 click: function() { … … Post = Select.extend({ 5579 5559 5580 5560 view.set( 'gallery', { 5581 5561 style: 'primary', 5582 text: l10n.createNewGallery,5562 text: wp.i18n.__( 'Create a new gallery' ), 5583 5563 priority: 60, 5584 5564 requires: { selection: true }, 5585 5565 … … Post = Select.extend({ 5609 5589 5610 5590 view.set( 'playlist', { 5611 5591 style: 'primary', 5612 text: l10n.createNewPlaylist,5592 text: wp.i18n.__( 'Create a new playlist' ), 5613 5593 priority: 100, 5614 5594 requires: { selection: true }, 5615 5595 … … Post = Select.extend({ 5639 5619 5640 5620 view.set( 'video-playlist', { 5641 5621 style: 'primary', 5642 text: l10n.createNewVideoPlaylist,5622 text: wp.i18n.__( 'Create a new video playlist' ), 5643 5623 priority: 100, 5644 5624 requires: { selection: true }, 5645 5625 … … Post = Select.extend({ 5682 5662 items: { 5683 5663 insert: { 5684 5664 style: 'primary', 5685 text: editing ? l10n.updateGallery : l10n.insertGallery,5665 text: editing ? wp.i18n.__( 'Update gallery' ) : wp.i18n.__( 'Insert gallery' ), 5686 5666 priority: 80, 5687 5667 requires: { library: true }, 5688 5668 … … Post = Select.extend({ 5711 5691 items: { 5712 5692 insert: { 5713 5693 style: 'primary', 5714 text: l10n.addToGallery,5694 text: wp.i18n.__( 'Add to gallery' ), 5715 5695 priority: 80, 5716 5696 requires: { selection: true }, 5717 5697 … … Post = Select.extend({ 5739 5719 items: { 5740 5720 insert: { 5741 5721 style: 'primary', 5742 text: editing ? l10n.updatePlaylist : l10n.insertPlaylist,5722 text: editing ? wp.i18n.__( 'Update audio playlist' ) : wp.i18n.__( 'Insert audio playlist' ), 5743 5723 priority: 80, 5744 5724 requires: { library: true }, 5745 5725 … … Post = Select.extend({ 5768 5748 items: { 5769 5749 insert: { 5770 5750 style: 'primary', 5771 text: l10n.addToPlaylist,5751 text: wp.i18n.__( 'Add to audio playlist' ), 5772 5752 priority: 80, 5773 5753 requires: { selection: true }, 5774 5754 … … Post = Select.extend({ 5796 5776 items: { 5797 5777 insert: { 5798 5778 style: 'primary', 5799 text: editing ? l10n.updateVideoPlaylist : l10n.insertVideoPlaylist,5779 text: editing ? wp.i18n.__( 'Update video playlist' ) : wp.i18n.__( 'Insert video playlist' ), 5800 5780 priority: 140, 5801 5781 requires: { library: true }, 5802 5782 … … Post = Select.extend({ 5825 5805 items: { 5826 5806 insert: { 5827 5807 style: 'primary', 5828 text: l10n.addToVideoPlaylist,5808 text: wp.i18n.__( 'Add to video playlist' ), 5829 5809 priority: 140, 5830 5810 requires: { selection: true }, 5831 5811 … … module.exports = Post; 5862 5842 */ 5863 5843 5864 5844 var MediaFrame = wp.media.view.MediaFrame, 5865 l10n = wp.media.view.l10n,5866 5845 Select; 5867 5846 5868 5847 Select = MediaFrame.extend({ … … Select = MediaFrame.extend({ 5949 5928 browseRouter: function( routerView ) { 5950 5929 routerView.set({ 5951 5930 upload: { 5952 text: l10n.uploadFilesTitle,5931 text: wp.i18n.__( 'Upload Files' ), 5953 5932 priority: 20 5954 5933 }, 5955 5934 browse: { 5956 text: l10n.mediaLibraryTitle,5935 text: wp.i18n.__( 'Media Library' ), 5957 5936 priority: 40 5958 5937 } 5959 5938 }); … … Search = wp.media.View.extend({ 7061 7040 7062 7041 attributes: { 7063 7042 type: 'search', 7064 placeholder: l10n.search7043 placeholder: wp.i18n.__( 'Search' ) 7065 7044 }, 7066 7045 7067 7046 events: { … … module.exports = Search; 7099 7078 * @augments wp.Backbone.View 7100 7079 * @augments Backbone.View 7101 7080 */ 7102 var l10n = wp.media.view.l10n, 7103 Selection; 7081 var Selection; 7104 7082 7105 7083 Selection = wp.media.View.extend({ 7106 7084 tagName: 'div', … … Selection = wp.media.View.extend({ 7151 7129 this.$el.toggleClass( 'one', 1 === collection.length ); 7152 7130 this.$el.toggleClass( 'editing', editing ); 7153 7131 7154 this.$('.count').text( l10n.selected.replace('%d', collection.length) );7132 this.$('.count').text( wp.i18n._n( '%d selected', '%d selected', collection.length ) ); 7155 7133 }, 7156 7134 7157 7135 edit: function( event ) { … … module.exports = Embed; 7780 7758 * @augments Backbone.View 7781 7759 */ 7782 7760 var Toolbar = wp.media.view.Toolbar, 7783 l10n = wp.media.view.l10n,7784 7761 Select; 7785 7762 7786 7763 Select = Toolbar.extend({ … … Select = Toolbar.extend({ 7794 7771 state: false, 7795 7772 reset: true, 7796 7773 close: true, 7797 text: l10n.select,7774 text: wp.i18n.__( 'Select' ), 7798 7775 7799 7776 // Does the button rely on the selection? 7800 7777 requires: { … … module.exports = Select; 7852 7829 * @augments Backbone.View 7853 7830 */ 7854 7831 var View = wp.media.View, 7855 l10n = wp.media.view.l10n,7856 7832 $ = jQuery, 7857 7833 EditorUploader; 7858 7834 … … EditorUploader = View.extend({ 7992 7968 this.workflow = wp.media.editor.open( window.wpActiveEditor, { 7993 7969 frame: 'post', 7994 7970 state: 'insert', 7995 title: l10n.addMedia,7971 title: wp.i18n.__( 'Add Media' ), 7996 7972 multiple: true 7997 7973 }); 7998 7974 -
src/wp-includes/js/media/audiovideo.manifest.js
diff --git src/wp-includes/js/media/audiovideo.manifest.js src/wp-includes/js/media/audiovideo.manifest.js index 7217e02..bf370b8 100644
1 1 var media = wp.media, 2 baseSettings = window._wpmejsSettings || {}, 3 l10n = window._wpMediaViewsL10n || {}; 2 baseSettings = window._wpmejsSettings || {}; 4 3 5 4 /** 6 5 * @mixin … … wp.media.mixin = { 78 77 */ 79 78 wp.media.playlist = new wp.media.collection({ 80 79 tag: 'playlist', 81 editTitle : l10n.editPlaylistTitle,80 editTitle : wp.i18n.__( 'Edit Audio Playlist' ), 82 81 defaults : { 83 82 id: wp.media.view.settings.post.id, 84 83 style: 'light', -
src/wp-includes/js/media/views/attachments/browser.js
diff --git src/wp-includes/js/media/views/attachments/browser.js src/wp-includes/js/media/views/attachments/browser.js index bd83278..7bcd4d4 100644
20 20 */ 21 21 var View = wp.media.View, 22 22 mediaTrash = wp.media.view.settings.mediaTrash, 23 l10n = wp.media.view.l10n,24 23 $ = jQuery, 25 24 AttachmentsBrowser; 26 25 … … AttachmentsBrowser = View.extend({ 98 97 // "Filters" will return a <select>, need to render 99 98 // screen reader text before 100 99 this.toolbar.set( 'filtersLabel', new wp.media.view.Label({ 101 value: l10n.filterByType,100 value: wp.i18n.__( 'Filter by type' ), 102 101 attributes: { 103 102 'for': 'media-attachment-filters' 104 103 }, … … AttachmentsBrowser = View.extend({ 138 137 139 138 // DateFilter is a <select>, screen reader text needs to be rendered before 140 139 this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({ 141 value: l10n.filterByDate,140 value: wp.i18n.__( 'Filter by date' ), 142 141 attributes: { 143 142 'for': 'media-attachment-date-filters' 144 143 }, … … AttachmentsBrowser = View.extend({ 152 151 153 152 // BulkSelection is a <div> with subviews, including screen reader text 154 153 this.toolbar.set( 'selectModeToggleButton', new wp.media.view.SelectModeToggleButton({ 155 text: l10n.bulkSelect,154 text: wp.i18n.__( 'Bulk Select' ), 156 155 controller: this.controller, 157 156 priority: -70 158 157 }).render() ); … … AttachmentsBrowser = View.extend({ 161 160 filters: Filters, 162 161 style: 'primary', 163 162 disabled: true, 164 text: mediaTrash ? l10n.trashSelected : l10n.deleteSelected,163 text: mediaTrash ? wp.i18n.__( 'Trash Selected' ) : wp.i18n.__( 'Delete Selected' ), 165 164 controller: this.controller, 166 165 priority: -60, 167 166 click: function() { … … AttachmentsBrowser = View.extend({ 173 172 return; 174 173 } 175 174 176 if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete) ) {175 if ( ! mediaTrash && ! window.confirm( wp.i18n.__( "You are about to permanently delete these items.\n 'Cancel' to stop, 'OK' to delete." ) ) ) { 177 176 return; 178 177 } 179 178 180 179 if ( mediaTrash && 181 180 'trash' !== selection.at( 0 ).get( 'status' ) && 182 ! window.confirm( l10n.warnBulkTrash) ) {181 ! window.confirm( wp.i18n.__( "You are about to trash these items.\n 'Cancel' to stop, 'OK' to delete." ) ) ) { 183 182 184 183 return; 185 184 } … … AttachmentsBrowser = View.extend({ 221 220 filters: Filters, 222 221 style: 'primary', 223 222 disabled: true, 224 text: l10n.deleteSelected,223 text: wp.i18n.__( 'Delete Selected' ), 225 224 controller: this.controller, 226 225 priority: -55, 227 226 click: function() { 228 227 var removed = [], selection = this.controller.state().get( 'selection' ); 229 228 230 if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete) ) {229 if ( ! selection.length || ! window.confirm( wp.i18n.__( "You are about to permanently delete these items.\n 'Cancel' to stop, 'OK' to delete." ) ) ) { 231 230 return; 232 231 } 233 232 … … AttachmentsBrowser = View.extend({ 249 248 } else if ( this.options.date ) { 250 249 // DateFilter is a <select>, screen reader text needs to be rendered before 251 250 this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({ 252 value: l10n.filterByDate,251 value: wp.i18n.__( 'Filter by date' ), 253 252 attributes: { 254 253 'for': 'media-attachment-date-filters' 255 254 }, … … AttachmentsBrowser = View.extend({ 265 264 if ( this.options.search ) { 266 265 // Search is an input, screen reader text needs to be rendered before 267 266 this.toolbar.set( 'searchLabel', new wp.media.view.Label({ 268 value: l10n.searchMediaLabel,267 value: wp.i18n.__( 'Search Media' ), 269 268 attributes: { 270 269 'for': 'media-search-input' 271 270 }, … … AttachmentsBrowser = View.extend({ 280 279 281 280 if ( this.options.dragInfo ) { 282 281 this.toolbar.set( 'dragInfo', new View({ 283 el: $( '<div class="instructions">' + l10n.dragInfo+ '</div>' )[0],282 el: $( '<div class="instructions">' + wp.i18n.__( 'Drag and drop to reorder media files.' ) + '</div>' )[0], 284 283 priority: -40 285 284 }) ); 286 285 } 287 286 288 287 if ( this.options.suggestedWidth && this.options.suggestedHeight ) { 289 288 this.toolbar.set( 'suggestedDimensions', new View({ 290 el: $( '<div class="instructions">' + l10n.suggestedDimensions+ ' ' + this.options.suggestedWidth + ' × ' + this.options.suggestedHeight + '</div>' )[0],289 el: $( '<div class="instructions">' + wp.i18n.__( 'Suggested image dimensions:' ) + ' ' + this.options.suggestedWidth + ' × ' + this.options.suggestedHeight + '</div>' )[0], 291 290 priority: -40 292 291 }) ); 293 292 } … … AttachmentsBrowser = View.extend({ 323 322 this.uploader = new wp.media.view.UploaderInline({ 324 323 controller: this.controller, 325 324 status: false, 326 message: this.controller.isModeActive( 'grid' ) ? '' : l10n.noItemsFound,325 message: this.controller.isModeActive( 'grid' ) ? '' : wp.i18n.__( 'No items found.' ), 327 326 canClose: this.controller.isModeActive( 'grid' ) 328 327 }); 329 328 … … AttachmentsBrowser = View.extend({ 367 366 }); 368 367 369 368 this.attachmentsNoResults.$el.addClass( 'hidden no-media' ); 370 this.attachmentsNoResults.$el.html( l10n.noMedia);369 this.attachmentsNoResults.$el.html( wp.i18n.__( 'No media files found.' ) ); 371 370 372 371 this.views.add( this.attachmentsNoResults ); 373 372 } -
src/wp-includes/js/media/views/button/select-mode-toggle.js
diff --git src/wp-includes/js/media/views/button/select-mode-toggle.js src/wp-includes/js/media/views/button/select-mode-toggle.js index 820e5de..73e03fd 100644
8 8 * @augments Backbone.View 9 9 */ 10 10 var Button = wp.media.view.Button, 11 l10n = wp.media.view.l10n,12 11 SelectModeToggle; 13 12 14 13 SelectModeToggle = Button.extend({ … … SelectModeToggle = Button.extend({ 50 49 if ( this.controller.isModeActive( 'select' ) ) { 51 50 this.model.set( { 52 51 size: 'large', 53 text: l10n.cancelSelection52 text: wp.i18n.__( 'Cancel Selection' ) 54 53 } ); 55 54 children.not( '.spinner, .media-button' ).hide(); 56 55 this.$el.show(); … … SelectModeToggle = Button.extend({ 58 57 } else { 59 58 this.model.set( { 60 59 size: '', 61 text: l10n.bulkSelect60 text: wp.i18n.__( 'Bulk Select' ) 62 61 } ); 63 62 this.controller.content.get().$el.removeClass( 'fixed' ); 64 63 toolbar.$el.css( 'width', '' ); -
src/wp-includes/js/media/views/cropper.js
diff --git src/wp-includes/js/media/views/cropper.js src/wp-includes/js/media/views/cropper.js index 9eb75c3..a7be928 100644
14 14 */ 15 15 var View = wp.media.View, 16 16 UploaderStatus = wp.media.view.UploaderStatus, 17 l10n = wp.media.view.l10n,18 17 $ = jQuery, 19 18 Cropper; 20 19 … … Cropper = View.extend({ 38 37 }, 39 38 prepare: function() { 40 39 return { 41 title: l10n.cropYourImage,40 title: wp.i18n.__( 'Crop your image' ), 42 41 url: this.options.attachment.get('url') 43 42 }; 44 43 }, … … Cropper = View.extend({ 57 56 58 57 this.views.add( '.upload-errors', new wp.media.view.UploaderStatusError({ 59 58 filename: UploaderStatus.prototype.filename(filename), 60 message: w indow._wpMediaViewsL10n.cropError59 message: wp.i18n.__( 'There has been an error cropping your image.' ) 61 60 }), { at: 0 }); 62 61 } 63 62 }); -
src/wp-includes/js/media/views/frame/post.js
diff --git src/wp-includes/js/media/views/frame/post.js src/wp-includes/js/media/views/frame/post.js index f4d078f..628f606 100644
Post = Select.extend({ 53 53 // Main states. 54 54 new Library({ 55 55 id: 'insert', 56 title: l10n.insertMediaTitle,56 title: wp.i18n.__( 'Insert Media' ), 57 57 priority: 20, 58 58 toolbar: 'main-insert', 59 59 filterable: 'all', … … Post = Select.extend({ 74 74 75 75 new Library({ 76 76 id: 'gallery', 77 title: l10n.createGalleryTitle,77 title: wp.i18n.__( 'Create Gallery' ), 78 78 priority: 40, 79 79 toolbar: 'main-gallery', 80 80 filterable: 'uploaded', … … Post = Select.extend({ 102 102 103 103 new Library({ 104 104 id: 'playlist', 105 title: l10n.createPlaylistTitle,105 title: wp.i18n.__( 'Create Audio Playlist' ), 106 106 priority: 60, 107 107 toolbar: 'main-playlist', 108 108 filterable: 'uploaded', … … Post = Select.extend({ 118 118 new wp.media.controller.CollectionEdit({ 119 119 type: 'audio', 120 120 collectionType: 'playlist', 121 title: l10n.editPlaylistTitle,121 title: wp.i18n.__( 'Edit Audio Playlist' ), 122 122 SettingsView: wp.media.view.Settings.Playlist, 123 123 library: options.selection, 124 124 editing: options.editing, 125 125 menu: 'playlist', 126 dragInfoText: l10n.playlistDragInfo,126 dragInfoText: wp.i18n.__( 'Drag and drop to reorder tracks.' ), 127 127 dragInfo: false 128 128 }), 129 129 130 130 new wp.media.controller.CollectionAdd({ 131 131 type: 'audio', 132 132 collectionType: 'playlist', 133 title: l10n.addToPlaylistTitle133 title: wp.i18n.__( 'Add to Audio Playlist' ) 134 134 }), 135 135 136 136 new Library({ 137 137 id: 'video-playlist', 138 title: l10n.createVideoPlaylistTitle,138 title: wp.i18n.__( 'Create Video Playlist' ), 139 139 priority: 60, 140 140 toolbar: 'main-video-playlist', 141 141 filterable: 'uploaded', … … Post = Select.extend({ 150 150 new wp.media.controller.CollectionEdit({ 151 151 type: 'video', 152 152 collectionType: 'playlist', 153 title: l10n.editVideoPlaylistTitle,153 title: wp.i18n.__( 'Edit Video Playlist' ), 154 154 SettingsView: wp.media.view.Settings.Playlist, 155 155 library: options.selection, 156 156 editing: options.editing, 157 157 menu: 'video-playlist', 158 dragInfoText: l10n.videoPlaylistDragInfo,158 dragInfoText: wp.i18n.__( 'Drag and drop to reorder videos.' ), 159 159 dragInfo: false 160 160 }), 161 161 162 162 new wp.media.controller.CollectionAdd({ 163 163 type: 'video', 164 164 collectionType: 'playlist', 165 title: l10n.addToVideoPlaylistTitle165 title: wp.i18n.__( 'Add to Video Playlist' ) 166 166 }) 167 167 ]); 168 168 … … Post = Select.extend({ 279 279 280 280 view.set({ 281 281 cancel: { 282 text: l10n.cancelGalleryTitle,282 text: wp.i18n.__( '← Cancel Gallery' ), 283 283 priority: 20, 284 284 click: function() { 285 285 if ( previous ) { … … Post = Select.extend({ 307 307 308 308 view.set({ 309 309 cancel: { 310 text: l10n.cancelPlaylistTitle,310 text: wp.i18n.__( '← Cancel Audio Playlist' ), 311 311 priority: 20, 312 312 click: function() { 313 313 if ( previous ) { … … Post = Select.extend({ 331 331 332 332 view.set({ 333 333 cancel: { 334 text: l10n.cancelVideoPlaylistTitle,334 text: wp.i18n.__( '← Cancel Video Playlist' ), 335 335 priority: 20, 336 336 click: function() { 337 337 if ( previous ) { … … Post = Select.extend({ 381 381 }).render(); 382 382 383 383 view.toolbar.set( 'backToLibrary', { 384 text: l10n.returnToLibrary,384 text: wp.i18n.__( '← Return to library' ), 385 385 priority: -100, 386 386 387 387 click: function() { … … Post = Select.extend({ 465 465 466 466 view.set( 'gallery', { 467 467 style: 'primary', 468 text: l10n.createNewGallery,468 text: wp.i18n.__( 'Create a new gallery' ), 469 469 priority: 60, 470 470 requires: { selection: true }, 471 471 … … Post = Select.extend({ 495 495 496 496 view.set( 'playlist', { 497 497 style: 'primary', 498 text: l10n.createNewPlaylist,498 text: wp.i18n.__( 'Create a new playlist' ), 499 499 priority: 100, 500 500 requires: { selection: true }, 501 501 … … Post = Select.extend({ 525 525 526 526 view.set( 'video-playlist', { 527 527 style: 'primary', 528 text: l10n.createNewVideoPlaylist,528 text: wp.i18n.__( 'Create a new video playlist' ), 529 529 priority: 100, 530 530 requires: { selection: true }, 531 531 … … Post = Select.extend({ 568 568 items: { 569 569 insert: { 570 570 style: 'primary', 571 text: editing ? l10n.updateGallery : l10n.insertGallery,571 text: editing ? wp.i18n.__( 'Update gallery' ) : wp.i18n.__( 'Insert gallery' ), 572 572 priority: 80, 573 573 requires: { library: true }, 574 574 … … Post = Select.extend({ 597 597 items: { 598 598 insert: { 599 599 style: 'primary', 600 text: l10n.addToGallery,600 text: wp.i18n.__( 'Add to gallery' ), 601 601 priority: 80, 602 602 requires: { selection: true }, 603 603 … … Post = Select.extend({ 625 625 items: { 626 626 insert: { 627 627 style: 'primary', 628 text: editing ? l10n.updatePlaylist : l10n.insertPlaylist,628 text: editing ? wp.i18n.__( 'Update audio playlist' ) : wp.i18n.__( 'Insert audio playlist' ), 629 629 priority: 80, 630 630 requires: { library: true }, 631 631 … … Post = Select.extend({ 654 654 items: { 655 655 insert: { 656 656 style: 'primary', 657 text: l10n.addToPlaylist,657 text: wp.i18n.__( 'Add to audio playlist' ), 658 658 priority: 80, 659 659 requires: { selection: true }, 660 660 … … Post = Select.extend({ 682 682 items: { 683 683 insert: { 684 684 style: 'primary', 685 text: editing ? l10n.updateVideoPlaylist : l10n.insertVideoPlaylist,685 text: editing ? wp.i18n.__( 'Update video playlist' ) : wp.i18n.__( 'Insert video playlist' ), 686 686 priority: 140, 687 687 requires: { library: true }, 688 688 … … Post = Select.extend({ 711 711 items: { 712 712 insert: { 713 713 style: 'primary', 714 text: l10n.addToVideoPlaylist,714 text: wp.i18n.__( 'Add to video playlist' ), 715 715 priority: 140, 716 716 requires: { selection: true }, 717 717 -
src/wp-includes/js/plupload/handlers.js
diff --git src/wp-includes/js/plupload/handlers.js src/wp-includes/js/plupload/handlers.js index 7f3a8c2..87fd256 100644
1 /* global plupload, pluploadL10n,ajaxurl, post_id, wpUploaderInit, deleteUserSetting, setUserSetting, getUserSetting, shortform */1 /* global plupload, ajaxurl, post_id, wpUploaderInit, deleteUserSetting, setUserSetting, getUserSetting, shortform */ 2 2 var topWin = window.dialogArguments || opener || parent || top, uploader, uploader_init; 3 3 4 4 // progress and success handlers for media multi uploads … … function fileUploading( up, file ) { 48 48 if ( max > hundredmb && file.size > hundredmb ) { 49 49 setTimeout( function() { 50 50 if ( file.status < 3 && file.loaded === 0 ) { // not uploading 51 wpFileError( file, pluploadL10n.big_upload_failed.replace( '%1$s', '<a class="uploader-html" href="#">' ).replace( '%2$s', '</a>' ) );51 wpFileError( file, wp.i18n.__( 'Please try uploading this file with the %1$sbrowser uploader%2$s.' ).replace( '%1$s', '<a class="uploader-html" href="#">' ).replace( '%2$s', '</a>' ) ); 52 52 up.stop(); // stops the whole queue 53 53 up.removeFile( file ); 54 54 up.start(); // restart the queue … … function uploadSuccess(fileObj, serverData) { 88 88 item.html(serverData); 89 89 return; 90 90 } else { 91 jQuery('.percent', item).html( pluploadL10n.crunching);91 jQuery('.percent', item).html( wp.i18n.__( 'Crunching…' ) ); 92 92 } 93 93 94 94 prepareMediaItem(fileObj, serverData); … … function itemAjaxError(id, message) { 213 213 return; 214 214 215 215 item.html('<div class="error-div">' + 216 '<a class="dismiss" href="#">' + pluploadL10n.dismiss + '</a>' + 217 '<strong>' + pluploadL10n.error_uploading.replace('%s', jQuery.trim(filename)) + '</strong> ' + 216 '<a class="dismiss" href="#">' + wp.i18n.__( 'Dismiss' ) + '</a>' + 217 /* translators: s: file name */ 218 '<strong>' + wp.i18n.__( '“%s” has failed to upload.' ).replace('%s', jQuery.trim(filename)) + '</strong> ' + 218 219 message + 219 220 '</div>').data('last-err', id); 220 221 } … … function deleteSuccess(data) { 249 250 250 251 jQuery('.filename:empty', item).remove(); 251 252 jQuery('.filename .title', item).css('font-weight','bold'); 252 jQuery('.filename', item).append('<span class="trashnotice"> ' + pluploadL10n.deleted+ ' </span>').siblings('a.toggle').hide();253 jQuery('.filename', item).append('<span class="trashnotice"> ' + wp.i18n.__( 'moved to the trash.' ) + ' </span>').siblings('a.toggle').hide(); 253 254 jQuery('.filename', item).append( jQuery('a.undo', item).removeClass('hidden') ); 254 255 jQuery('.menu_order_input', item).hide(); 255 256 … … function uploadError(fileObj, errorCode, message, uploader) { 282 283 283 284 switch (errorCode) { 284 285 case plupload.FAILED: 285 wpFileError( fileObj, pluploadL10n.upload_failed);286 wpFileError( fileObj, wp.i18n.__( 'Upload failed.' ) ); 286 287 break; 287 288 case plupload.FILE_EXTENSION_ERROR: 288 wpFileExtensionError( uploader, fileObj, pluploadL10n.invalid_filetype);289 wpFileExtensionError( uploader, fileObj, wp.i18n.__( 'This file type is not allowed. Please try another.' ) ); 289 290 break; 290 291 case plupload.FILE_SIZE_ERROR: 291 uploadSizeError( uploader, fileObj);292 uploadSizeError( uploader, fileObj ); 292 293 break; 293 294 case plupload.IMAGE_FORMAT_ERROR: 294 wpFileError( fileObj, pluploadL10n.not_an_image);295 wpFileError( fileObj, wp.i18n.__( 'This file is not an image. Please try another.' ) ); 295 296 break; 296 297 case plupload.IMAGE_MEMORY_ERROR: 297 wpFileError( fileObj, pluploadL10n.image_memory_exceeded);298 wpFileError( fileObj, wp.i18n.__( 'Memory exceeded. Please try another smaller file.' ) ); 298 299 break; 299 300 case plupload.IMAGE_DIMENSIONS_ERROR: 300 wpFileError( fileObj, pluploadL10n.image_dimensions_exceeded);301 wpFileError( fileObj, wp.i18n.__( 'This is larger than the maximum size. Please try another.' ) ); 301 302 break; 302 303 case plupload.GENERIC_ERROR: 303 wpQueueError( pluploadL10n.upload_failed);304 wpQueueError( wp.i18n.__( 'Upload failed.' ) ); 304 305 break; 305 306 case plupload.IO_ERROR: 306 307 max = parseInt( uploader.settings.filters.max_file_size, 10 ); 307 308 308 309 if ( max > hundredmb && fileObj.size > hundredmb ) 309 wpFileError( fileObj, pluploadL10n.big_upload_failed.replace('%1$s', '<a class="uploader-html" href="#">').replace('%2$s', '</a>') );310 wpFileError( fileObj, wp.i18n.__( 'Please try uploading this file with the %1$sbrowser uploader%2$s.' ).replace( '%1$s', '<a class="uploader-html" href="#">' ).replace( '%2$s', '</a>' ) ); 310 311 else 311 wpQueueError( pluploadL10n.io_error);312 wpQueueError( wp.i18n.__( 'IO error.' ) ); 312 313 break; 313 314 case plupload.HTTP_ERROR: 314 wpQueueError( pluploadL10n.http_error);315 wpQueueError( wp.i18n.__( 'HTTP error.' ) ); 315 316 break; 316 317 case plupload.INIT_ERROR: 317 318 jQuery('.media-upload-form').addClass('html-uploader'); 318 319 break; 319 320 case plupload.SECURITY_ERROR: 320 wpQueueError( pluploadL10n.security_error);321 wpQueueError( wp.i18n.__( 'Security error.' ) ); 321 322 break; 322 323 /* case plupload.UPLOAD_ERROR.UPLOAD_STOPPED: 323 324 case plupload.UPLOAD_ERROR.FILE_CANCELLED: 324 325 jQuery('#media-item-' + fileObj.id).remove(); 325 326 break;*/ 326 327 default: 327 wpFileError( fileObj, pluploadL10n.default_error);328 wpFileError( fileObj, wp.i18n.__( 'An error occurred in the upload. Please try again later.' ) ); 328 329 } 329 330 } 330 331 331 332 function uploadSizeError( up, file, over100mb ) { 332 333 var message; 333 334 334 if ( over100mb ) 335 message = pluploadL10n.big_upload_queued.replace('%s', file.name) + ' ' + pluploadL10n.big_upload_failed.replace('%1$s', '<a class="uploader-html" href="#">').replace('%2$s', '</a>'); 336 else 337 message = pluploadL10n.file_exceeds_size_limit.replace('%s', file.name); 335 if ( over100mb ) { 336 /* translators: s: file name */ 337 message = wp.i18n.__( '%s exceeds the maximum upload size for the multi-file uploader when used in your browser.' ).replace( '%s', file.name ) + ' ' + wp.i18n.__( 'Please try uploading this file with the %1$sbrowser uploader%2$s.' ).replace( '%1$s', '<a class="uploader-html" href="#">' ).replace( '%2$s', '</a>' ); 338 } else { 339 /* translators: s: file name */ 340 message = wp.i18n.__( '%s exceeds the maximum upload size for this site.' ).replace( '%s', file.name ); 341 } 338 342 339 343 jQuery('#media-items').append('<div id="media-item-' + file.id + '" class="media-item error"><p>' + message + '</p></div>'); 340 344 up.removeFile(file); -
src/wp-includes/js/plupload/wp-plupload.js
diff --git src/wp-includes/js/plupload/wp-plupload.js src/wp-includes/js/plupload/wp-plupload.js index 032a38f..872f01a 100644
1 /* global plupload L10n, plupload, _wpPluploadSettings */1 /* global plupload, _wpPluploadSettings */ 2 2 3 3 window.wp = window.wp || {}; 4 4 … … window.wp = window.wp || {}; 120 120 } 121 121 122 122 Uploader.errors.unshift({ 123 message: message || pluploadL10n.default_error,123 message: message || wp.i18n.__( 'An error occurred in the upload. Please try again later.' ), 124 124 data: data, 125 125 file: file 126 126 }); … … window.wp = window.wp || {}; 264 264 try { 265 265 response = JSON.parse( response.response ); 266 266 } catch ( e ) { 267 return error( pluploadL10n.default_error, e, file );267 return error( wp.i18n.__( 'An error occurred in the upload. Please try again later.' ), e, file ); 268 268 } 269 269 270 270 if ( ! _.isObject( response ) || _.isUndefined( response.success ) ) 271 return error( pluploadL10n.default_error, null, file );271 return error( wp.i18n.__( 'An error occurred in the upload. Please try again later.' ), null, file ); 272 272 else if ( ! response.success ) 273 273 return error( response.data && response.data.message, response.data, file ); 274 274 … … window.wp = window.wp || {}; 296 296 * @param {Object} error Contains code, message and sometimes file and other details. 297 297 */ 298 298 this.uploader.bind( 'Error', function( up, pluploadError ) { 299 var message = pluploadL10n.default_error,299 var message = wp.i18n.__( 'An error occurred in the upload. Please try again later.' ), 300 300 key; 301 301 302 302 // Check for plupload errors. … … window.wp = window.wp || {}; 325 325 326 326 // Map Plupload error codes to user friendly error messages. 327 327 Uploader.errorMap = { 328 'FAILED': pluploadL10n.upload_failed,329 'FILE_EXTENSION_ERROR': pluploadL10n.invalid_filetype,330 'IMAGE_FORMAT_ERROR': pluploadL10n.not_an_image,331 'IMAGE_MEMORY_ERROR': pluploadL10n.image_memory_exceeded,332 'IMAGE_DIMENSIONS_ERROR': pluploadL10n.image_dimensions_exceeded,333 'GENERIC_ERROR': pluploadL10n.upload_failed,334 'IO_ERROR': pluploadL10n.io_error,335 'HTTP_ERROR': pluploadL10n.http_error,336 'SECURITY_ERROR': pluploadL10n.security_error,328 'FAILED': wp.i18n.__( 'Upload failed.' ), 329 'FILE_EXTENSION_ERROR': wp.i18n.__( 'This file type is not allowed. Please try another.' ), 330 'IMAGE_FORMAT_ERROR': wp.i18n.__( 'This file is not an image. Please try another.' ), 331 'IMAGE_MEMORY_ERROR': wp.i18n.__( 'Memory exceeded. Please try another smaller file.' ), 332 'IMAGE_DIMENSIONS_ERROR': wp.i18n.__( 'This is larger than the maximum size. Please try another.' ), 333 'GENERIC_ERROR': wp.i18n.__( 'Upload failed.' ), 334 'IO_ERROR': wp.i18n.__( 'IO error.' ), 335 'HTTP_ERROR': wp.i18n.__( 'HTTP error.' ), 336 'SECURITY_ERROR': wp.i18n.__( 'Security error.' ), 337 337 338 338 'FILE_SIZE_ERROR': function( file ) { 339 return pluploadL10n.file_exceeds_size_limit.replace('%s', file.name); 339 /* translators: s: file name */ 340 return wp.i18n.__( '%s exceeds the maximum upload size for this site.' ).replace('%s', file.name); 340 341 } 341 342 }; 342 343 -
src/wp-includes/js/quicktags.js
diff --git src/wp-includes/js/quicktags.js src/wp-includes/js/quicktags.js index 6d00901..804728f 100644
1 /* global adminpage, wpActiveEditor, quicktagsL10n,wpLink, prompt */1 /* global adminpage, wpActiveEditor, wpLink, prompt */ 2 2 /* 3 3 * Quicktags 4 4 * … … function edButton(id, display, tagStart, tagEnd, access) { 223 223 224 224 if ( tb.addEventListener ) { 225 225 tb.addEventListener( 'click', onclick, false ); 226 226 227 227 if ( wrap ) { 228 228 wrap.addEventListener( 'click', setActiveEditor, false ); 229 229 } … … function edButton(id, display, tagStart, tagEnd, access) { 582 582 583 583 // the close tags button 584 584 qt.CloseButton = function() { 585 qt.Button.call( this, 'close', quicktagsL10n.closeTags, '', quicktagsL10n.closeAllOpenTags);585 qt.Button.call( this, 'close', wp.i18n.__( 'close tags' ), '', wp.i18n.__( 'Close all open tags' ) ); 586 586 }; 587 587 588 588 qt.CloseButton.prototype = new qt.Button(); … … function edButton(id, display, tagStart, tagEnd, access) { 614 614 // the link button 615 615 qt.LinkButton = function() { 616 616 var attr = { 617 ariaLabel: quicktagsL10n.link617 ariaLabel: wp.i18n.__( 'Insert link' ) 618 618 }; 619 619 620 620 qt.TagButton.call( this, 'link', 'link', '', '</a>', '', '', '', attr ); … … function edButton(id, display, tagStart, tagEnd, access) { 633 633 } 634 634 635 635 if ( t.isOpen(ed) === false ) { 636 URL = prompt( quicktagsL10n.enterURL, defaultValue );636 URL = prompt( wp.i18n.__( 'Enter the URL' ), defaultValue ); 637 637 if ( URL ) { 638 638 t.tagStart = '<a href="' + URL + '">'; 639 639 qt.TagButton.prototype.callback.call(t, e, c, ed); … … function edButton(id, display, tagStart, tagEnd, access) { 646 646 // the img button 647 647 qt.ImgButton = function() { 648 648 var attr = { 649 ariaLabel: quicktagsL10n.image649 ariaLabel: wp.i18n.__( 'Insert image' ) 650 650 }; 651 651 652 652 qt.TagButton.call( this, 'img', 'img', '', '', '', '', '', attr ); … … function edButton(id, display, tagStart, tagEnd, access) { 656 656 if ( ! defaultValue ) { 657 657 defaultValue = 'http://'; 658 658 } 659 var src = prompt( quicktagsL10n.enterImageURL, defaultValue), alt;659 var src = prompt( wp.i18n.__( 'Enter the URL of the image' ), defaultValue ), alt; 660 660 if ( src ) { 661 alt = prompt( quicktagsL10n.enterImageDescription, '');661 alt = prompt( wp.i18n.__( 'Enter a description of the image' ), '' ); 662 662 this.tagStart = '<img src="' + src + '" alt="' + alt + '" />'; 663 663 qt.TagButton.prototype.callback.call(this, e, c, ed); 664 664 } 665 665 }; 666 666 667 667 qt.DFWButton = function() { 668 qt.Button.call( this, 'dfw', '', 'f', quicktagsL10n.dfw);668 qt.Button.call( this, 'dfw', '', 'f', wp.i18n.__( 'Distraction-free writing mode' ) ); 669 669 }; 670 670 qt.DFWButton.prototype = new qt.Button(); 671 671 qt.DFWButton.prototype.callback = function() { … … function edButton(id, display, tagStart, tagEnd, access) { 679 679 }; 680 680 681 681 qt.TextDirectionButton = function() { 682 qt.Button.call( this, 'textdirection', quicktagsL10n.textdirection, '', quicktagsL10n.toggleTextdirection);682 qt.Button.call( this, 'textdirection', wp.i18n.__( 'text direction' ), '', wp.i18n.__( 'Toggle Editor Text Direction' ) ); 683 683 }; 684 684 qt.TextDirectionButton.prototype = new qt.Button(); 685 685 qt.TextDirectionButton.prototype.callback = function(e, c) { … … function edButton(id, display, tagStart, tagEnd, access) { 695 695 }; 696 696 697 697 // ensure backward compatibility 698 edButtons[10] = new qt.TagButton( 'strong', 'b', '<strong>', '</strong>', '', '', '', { ariaLabel: quicktagsL10n.strong, ariaLabelClose: quicktagsL10n.strongClose} );699 edButtons[20] = new qt.TagButton( 'em', 'i', '<em>', '</em>', '', '', '', { ariaLabel: quicktagsL10n.em, ariaLabelClose: quicktagsL10n.emClose} );698 edButtons[10] = new qt.TagButton( 'strong', 'b', '<strong>', '</strong>', '', '', '', { ariaLabel: wp.i18n.__( 'Bold' ), ariaLabelClose: wp.i18n.__( 'Close bold tag' ) } ); 699 edButtons[20] = new qt.TagButton( 'em', 'i', '<em>', '</em>', '', '', '', { ariaLabel: wp.i18n.__( 'Italic' ), ariaLabelClose: wp.i18n.__( 'Close italic tag' ) } ); 700 700 edButtons[30] = new qt.LinkButton(); // special case 701 edButtons[40] = new qt.TagButton( 'block', 'b-quote', '\n\n<blockquote>', '</blockquote>\n\n', '', '', '', { ariaLabel: quicktagsL10n.blockquote, ariaLabelClose: quicktagsL10n.blockquoteClose} );702 edButtons[50] = new qt.TagButton( 'del', 'del', '<del datetime="' + _datetime + '">', '</del>', '', '', '', { ariaLabel: quicktagsL10n.del, ariaLabelClose: quicktagsL10n.delClose} );703 edButtons[60] = new qt.TagButton( 'ins', 'ins', '<ins datetime="' + _datetime + '">', '</ins>', '', '', '', { ariaLabel: quicktagsL10n.ins, ariaLabelClose: quicktagsL10n.insClose} );701 edButtons[40] = new qt.TagButton( 'block', 'b-quote', '\n\n<blockquote>', '</blockquote>\n\n', '', '', '', { ariaLabel: wp.i18n.__( 'Blockquote' ), ariaLabelClose: wp.i18n.__( 'Close blockquote tag' ) } ); 702 edButtons[50] = new qt.TagButton( 'del', 'del', '<del datetime="' + _datetime + '">', '</del>', '', '', '', { ariaLabel: wp.i18n.__( 'Deleted text (strikethrough)' ), ariaLabelClose: wp.i18n.__( 'Close deleted text tag' ) } ); 703 edButtons[60] = new qt.TagButton( 'ins', 'ins', '<ins datetime="' + _datetime + '">', '</ins>', '', '', '', { ariaLabel: wp.i18n.__( 'Inserted text' ), ariaLabelClose: wp.i18n.__( 'Close inserted text tag' ) } ); 704 704 edButtons[70] = new qt.ImgButton(); // special case 705 edButtons[80] = new qt.TagButton( 'ul', 'ul', '<ul>\n', '</ul>\n\n', '', '', '', { ariaLabel: quicktagsL10n.ul, ariaLabelClose: quicktagsL10n.ulClose} );706 edButtons[90] = new qt.TagButton( 'ol', 'ol', '<ol>\n', '</ol>\n\n', '', '', '', { ariaLabel: quicktagsL10n.ol, ariaLabelClose: quicktagsL10n.olClose} );707 edButtons[100] = new qt.TagButton( 'li', 'li', '\t<li>', '</li>\n', '', '', '', { ariaLabel: quicktagsL10n.li, ariaLabelClose: quicktagsL10n.liClose} );708 edButtons[110] = new qt.TagButton( 'code', 'code', '<code>', '</code>', '', '', '', { ariaLabel: quicktagsL10n.code, ariaLabelClose: quicktagsL10n.codeClose} );709 edButtons[120] = new qt.TagButton( 'more', 'more', '<!--more-->\n\n', '', '', '', '', { ariaLabel: quicktagsL10n.more} );705 edButtons[80] = new qt.TagButton( 'ul', 'ul', '<ul>\n', '</ul>\n\n', '', '', '', { ariaLabel: wp.i18n.__( 'Bulleted list' ), ariaLabelClose: wp.i18n.__( 'Close bulleted list tag' ) } ); 706 edButtons[90] = new qt.TagButton( 'ol', 'ol', '<ol>\n', '</ol>\n\n', '', '', '', { ariaLabel: wp.i18n.__( 'Numbered list' ), ariaLabelClose: wp.i18n.__( 'Close numbered list tag' ) } ); 707 edButtons[100] = new qt.TagButton( 'li', 'li', '\t<li>', '</li>\n', '', '', '', { ariaLabel: wp.i18n.__( 'List item' ), ariaLabelClose: wp.i18n.__( 'Close list item tag' ) } ); 708 edButtons[110] = new qt.TagButton( 'code', 'code', '<code>', '</code>', '', '', '', { ariaLabel: wp.i18n.__( 'Code' ), ariaLabelClose: wp.i18n.__( 'Close code tag' ) } ); 709 edButtons[120] = new qt.TagButton( 'more', 'more', '<!--more-->\n\n', '', '', '', '', { ariaLabel: wp.i18n.__( 'Insert Read More tag' ) } ); 710 710 edButtons[140] = new qt.CloseButton(); 711 711 712 712 })(); -
src/wp-includes/js/swfupload/handlers.js
diff --git src/wp-includes/js/swfupload/handlers.js src/wp-includes/js/swfupload/handlers.js index e27bd37..fc22063 100644
function uploadProgress(fileObj, bytesDone, bytesTotal) { 45 45 jQuery('.percent', item).html( Math.ceil(bytesDone / bytesTotal * 100) + '%' ); 46 46 47 47 if ( bytesDone == bytesTotal ) 48 jQuery('.bar', item).html('<strong class="crunching">' + swfuploadL10n.crunching+ '</strong>');48 jQuery('.bar', item).html('<strong class="crunching">' + wp.i18n.__( 'Crunching…' ) + '</strong>'); 49 49 } 50 50 51 51 function prepareMediaItem(fileObj, serverData) { … … function itemAjaxError(id, html) { 154 154 var filename = jQuery('.filename', item).text(); 155 155 156 156 item.html('<div class="error-div">' 157 + '<a class="dismiss" href="#">' + swfuploadL10n.dismiss + '</a>' 158 + '<strong>' + swfuploadL10n.error_uploading.replace('%s', filename) + '</strong><br />' 157 + '<a class="dismiss" href="#">' + wp.i18n.__( 'Dismiss' ) + '</a>' 158 /* translators: s: file name */ 159 + '<strong>' + wp.i18n.__( '“%s” has failed to upload.' ).replace( '%s', filename ) + '</strong><br />' 159 160 + html 160 161 + '</div>'); 161 162 item.find('a.dismiss').click(function(){jQuery(this).parents('.media-item').slideUp(200, function(){jQuery(this).remove();})}); … … function deleteSuccess(data, textStatus) { 187 188 188 189 jQuery('.filename:empty', item).remove(); 189 190 jQuery('.filename .title', item).css('font-weight','bold'); 190 jQuery('.filename', item).append('<span class="trashnotice"> ' + swfuploadL10n.deleted+ ' </span>').siblings('a.toggle').hide();191 jQuery('.filename', item).append('<span class="trashnotice"> ' + wp.i18n.__( 'moved to the trash.' ) + ' </span>').siblings('a.toggle').hide(); 191 192 jQuery('.filename', item).append( jQuery('a.undo', item).removeClass('hidden') ); 192 193 jQuery('.menu_order_input', item).hide(); 193 194 … … function wpFileError(fileObj, message) { 257 258 var filename = jQuery('.filename', item).text(); 258 259 259 260 item.html('<div class="error-div">' 260 + '<a class="dismiss" href="#">' + swfuploadL10n.dismiss + '</a>' 261 + '<strong>' + swfuploadL10n.error_uploading.replace('%s', filename) + '</strong><br />' 261 + '<a class="dismiss" href="#">' + wp.i18n.__( 'Dismiss' ) + '</a>' 262 /* translators: s: file name */ 263 + '<strong>' + wp.i18n.__( '“%s” has failed to upload.' ).replace( '%s', filename ) + '</strong><br />' 262 264 + message 263 265 + '</div>'); 264 266 item.find('a.dismiss').click(function(){jQuery(this).parents('.media-item').slideUp(200, function(){jQuery(this).remove();})}); … … function wpFileError(fileObj, message) { 267 269 function fileQueueError(fileObj, error_code, message) { 268 270 // Handle this error separately because we don't want to create a FileProgress element for it. 269 271 if ( error_code == SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED ) { 270 wpQueueError( swfuploadL10n.queue_limit_exceeded);272 wpQueueError( wp.i18n.__( 'You have attempted to queue too many files.' ) ); 271 273 } 272 274 else if ( error_code == SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT ) { 273 275 fileQueued(fileObj); 274 wpFileError(fileObj, swfuploadL10n.file_exceeds_size_limit); 276 /* translators: s: file name */ 277 wpFileError( fileObj, wp.i18n.__( '%s exceeds the maximum upload size for this site.' ) ); 275 278 } 276 279 else if ( error_code == SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE ) { 277 280 fileQueued(fileObj); 278 wpFileError( fileObj, swfuploadL10n.zero_byte_file);281 wpFileError( fileObj, wp.i18n.__( 'This file is empty. Please try another.' ) ); 279 282 } 280 283 else if ( error_code == SWFUpload.QUEUE_ERROR.INVALID_FILETYPE ) { 281 284 fileQueued(fileObj); 282 wpFileError( fileObj, swfuploadL10n.invalid_filetype);285 wpFileError( fileObj, wp.i18n.__( 'This file type is not allowed. Please try another.' ) ); 283 286 } 284 287 else { 285 wpQueueError( swfuploadL10n.default_error);288 wpQueueError( wp.i18n.__( 'An error occurred in the upload. Please try again later.' ) ); 286 289 } 287 290 } 288 291 … … function uploadError(fileObj, errorCode, message) { 324 327 325 328 switch (errorCode) { 326 329 case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL: 327 wpFileError( fileObj, swfuploadL10n.missing_upload_url);330 wpFileError( fileObj, wp.i18n.__( 'There was a configuration error. Please contact the server administrator.' ) ); 328 331 break; 329 332 case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED: 330 wpFileError( fileObj, swfuploadL10n.upload_limit_exceeded);333 wpFileError( fileObj, wp.i18n.__( 'You may only upload 1 file.' ) ); 331 334 break; 332 335 case SWFUpload.UPLOAD_ERROR.HTTP_ERROR: 333 wpQueueError( swfuploadL10n.http_error);336 wpQueueError( wp.i18n.__( 'HTTP error.' ) ); 334 337 break; 335 338 case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED: 336 wpQueueError( swfuploadL10n.upload_failed);339 wpQueueError( wp.i18n.__( 'Upload failed.' ) ); 337 340 break; 338 341 case SWFUpload.UPLOAD_ERROR.IO_ERROR: 339 wpQueueError( swfuploadL10n.io_error);342 wpQueueError( wp.i18n.__( 'IO error.' ) ); 340 343 break; 341 344 case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR: 342 wpQueueError( swfuploadL10n.security_error);345 wpQueueError( wp.i18n.__( 'Security error.' ) ); 343 346 break; 344 347 case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED: 345 348 case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED: 346 349 jQuery('#media-item-' + fileObj.id).remove(); 347 350 break; 348 351 default: 349 wpFileError( fileObj, swfuploadL10n.default_error);352 wpFileError( fileObj, wp.i18n.__( 'An error occurred in the upload. Please try again later.' ) ); 350 353 } 351 354 } 352 355 -
src/wp-includes/js/thickbox/thickbox.js
diff --git src/wp-includes/js/thickbox/thickbox.js src/wp-includes/js/thickbox/thickbox.js index 391fd41..ef1c091 100644
function tb_show(caption, url, imageGroup) {//function called when the user clic 48 48 jQuery("body","html").css({height: "100%", width: "100%"}); 49 49 jQuery("html").css("overflow","hidden"); 50 50 if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6 51 jQuery("body").append("<iframe id='TB_HideSelect'>" +thickboxL10n.noiframes+"</iframe><div id='TB_overlay'></div><div id='TB_window' class='thickbox-loading'></div>");51 jQuery("body").append("<iframe id='TB_HideSelect'>" + wp.i18n.__( 'This feature requires inline frames. You have iframes disabled or your browser does not support them.' ) + "</iframe><div id='TB_overlay'></div><div id='TB_window' class='thickbox-loading'></div>"); 52 52 jQuery("#TB_overlay").click(tb_remove); 53 53 } 54 54 }else{//all others … … function tb_show(caption, url, imageGroup) {//function called when the user clic 97 97 if (TB_FoundURL) { 98 98 TB_NextCaption = TB_TempArray[TB_Counter].title; 99 99 TB_NextURL = TB_TempArray[TB_Counter].href; 100 TB_NextHTML = "<span id='TB_next'> <a href='#'>"+ thickboxL10n.next+"</a></span>";100 TB_NextHTML = "<span id='TB_next'> <a href='#'>"+wp.i18n.__( 'Next >' )+"</a></span>"; 101 101 } else { 102 102 TB_PrevCaption = TB_TempArray[TB_Counter].title; 103 103 TB_PrevURL = TB_TempArray[TB_Counter].href; 104 TB_PrevHTML = "<span id='TB_prev'> <a href='#'>" +thickboxL10n.prev+"</a></span>";104 TB_PrevHTML = "<span id='TB_prev'> <a href='#'>" + wp.i18n.__( '< Prev' ) + "</a></span>"; 105 105 } 106 106 } else { 107 107 TB_FoundURL = true; 108 TB_imageCount = thickboxL10n.image + ' ' + (TB_Counter + 1) + ' ' + thickboxL10n.of + ' ' + (TB_TempArray.length); 108 /* translators: 1: image number, 2: total number of images */ 109 TB_imageCount = wp.i18n.__( 'Image %1$d of %2$d' ).replace( '%1$d', ( TB_Counter + 1 ) ).replace( '%2$d', TB_TempArray.length ); 109 110 } 110 111 } 111 112 } … … function tb_show(caption, url, imageGroup) {//function called when the user clic 139 140 140 141 TB_WIDTH = imageWidth + 30; 141 142 TB_HEIGHT = imageHeight + 60; 142 jQuery("#TB_window").append("<a href='' id='TB_ImageOff'><span class='screen-reader-text'>" +thickboxL10n.close+"</span><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><button type='button' id='TB_closeWindowButton'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><span class='tb-close-icon'></span></button></div>");143 jQuery("#TB_window").append("<a href='' id='TB_ImageOff'><span class='screen-reader-text'>" + wp.i18n.__( 'Close' ) + "</span><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><button type='button' id='TB_closeWindowButton'><span class='screen-reader-text'>" + wp.i18n.__( 'Close' ) + "</span><span class='tb-close-icon'></span></button></div>"); 143 144 144 145 jQuery("#TB_closeWindowButton").click(tb_remove); 145 146 … … function tb_show(caption, url, imageGroup) {//function called when the user clic 204 205 urlNoQuery = url.split('TB_'); 205 206 jQuery("#TB_iframeContent").remove(); 206 207 if(params['modal'] != "true"){//iframe no modal 207 jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><button type='button' id='TB_closeWindowButton'><span class='screen-reader-text'>" +thickboxL10n.close+"</span><span class='tb-close-icon'></span></button></div></div><iframe frameborder='0' hspace='0' allowtransparency='true' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' >"+thickboxL10n.noiframes+"</iframe>");208 jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><button type='button' id='TB_closeWindowButton'><span class='screen-reader-text'>" + wp.i18n.__( 'Close' ) + "</span><span class='tb-close-icon'></span></button></div></div><iframe frameborder='0' hspace='0' allowtransparency='true' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' >" + wp.i18n.__( 'This feature requires inline frames. You have iframes disabled or your browser does not support them.' ) + "</iframe>"); 208 209 }else{//iframe modal 209 210 jQuery("#TB_overlay").unbind(); 210 jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' allowtransparency='true' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'>" +thickboxL10n.noiframes+"</iframe>");211 jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' allowtransparency='true' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'>" + wp.i18n.__( 'This feature requires inline frames. You have iframes disabled or your browser does not support them.' ) + "</iframe>"); 211 212 } 212 213 }else{// not an iframe, ajax 213 214 if(jQuery("#TB_window").css("visibility") != "visible"){ 214 215 if(params['modal'] != "true"){//ajax no modal 215 jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><button type='button' id='TB_closeWindowButton'><span class='screen-reader-text'>" +thickboxL10n.close+"</span><span class='tb-close-icon'></span></button></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");216 jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><button type='button' id='TB_closeWindowButton'><span class='screen-reader-text'>" + wp.i18n.__( 'Close' ) + "</span><span class='tb-close-icon'></span></button></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>"); 216 217 }else{//ajax modal 217 218 jQuery("#TB_overlay").unbind(); 218 219 jQuery("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>"); -
src/wp-includes/js/tinymce/plugins/wplink/plugin.js
diff --git src/wp-includes/js/tinymce/plugins/wplink/plugin.js src/wp-includes/js/tinymce/plugins/wplink/plugin.js index 1ce1c92..27428e9 100644
271 271 editor.nodeChanged(); 272 272 273 273 // Audible confirmation message when a link has been inserted in the Editor. 274 if ( typeof window.wpLinkL10n !== 'undefined' &&! hasLinkError ) {275 speak( w indow.wpLinkL10n.linkInserted);274 if ( ! hasLinkError ) { 275 speak( wp.i18n.__( 'Link inserted.' ) );