Changeset 48348
- Timestamp:
- 07/06/2020 08:15:46 PM (5 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/edit-comments.js
r48104 r48348 7 7 */ 8 8 9 /* global adminComments L10n, thousandsSeparator, list_args, QTags, ajaxurl, wpAjax */9 /* global adminCommentsSettings, thousandsSeparator, list_args, QTags, ajaxurl, wpAjax */ 10 10 /* global commentReply, theExtraList, theList, setCommentsList */ 11 11 … … 14 14 updateHtmlTitle, updateDashboardText, updateInModerationText, adminTitle = document.title, 15 15 isDashboard = $('#dashboard_right_now').length, 16 titleDiv, titleRegEx; 16 titleDiv, titleRegEx, 17 __ = wp.i18n.__; 17 18 18 19 /** … … 192 193 var newTitle, regExMatch, titleCount, commentFrag; 193 194 194 titleRegEx = titleRegEx || new RegExp( adminCommentsL10n.docTitleCommentsCount.replace( '%s', '\\([0-9' + thousandsSeparator + ']+\\)' ) + '?' ); 195 /* translators: %s: Comments count. */ 196 titleRegEx = titleRegEx || new RegExp( __( 'Comments (%s)' ).replace( '%s', '\\([0-9' + thousandsSeparator + ']+\\)' ) + '?' ); 195 197 // Count funcs operate on a $'d element. 196 198 titleDiv = titleDiv || $( '<div />' ); … … 211 213 regExMatch = titleRegEx.exec( document.title ); 212 214 if ( regExMatch ) { 213 newTitle = document.title.replace( regExMatch[0], adminCommentsL10n.docTitleCommentsCount.replace( '%s', titleDiv.text() ) + ' ' ); 215 /* translators: %s: Comments count. */ 216 newTitle = document.title.replace( regExMatch[0], __( 'Comments (%s)' ).replace( '%s', titleDiv.text() ) + ' ' ); 214 217 } 215 218 } else { 216 219 regExMatch = titleRegEx.exec( newTitle ); 217 220 if ( regExMatch ) { 218 newTitle = newTitle.replace( regExMatch[0], adminCommentsL10n.docTitleComments);221 newTitle = newTitle.replace( regExMatch[0], __( 'Comments11' ) ); 219 222 } 220 223 } … … 361 364 if ( c.is('.unapproved') ) { 362 365 if ( settings.data.id == replyID ) 363 replyButton.text( adminCommentsL10n.replyApprove);366 replyButton.text( __( 'Approve and Reply' ) ); 364 367 365 368 c.find( '.row-actions span.view' ).addClass( 'hidden' ).end() … … 368 371 } else { 369 372 if ( settings.data.id == replyID ) 370 replyButton.text( adminCommentsL10n.reply);373 replyButton.text( __( 'Reply' ) ); 371 374 372 375 c.find( '.row-actions span.view' ).removeClass( 'hidden' ).end() … … 847 850 */ 848 851 toggle : function(el) { 849 if ( 'none' !== $( el ).css( 'display' ) && ( $( '#replyrow' ).parent().is('#com-reply') || window.confirm( adminCommentsL10n.warnQuickEdit) ) ) {852 if ( 'none' !== $( el ).css( 'display' ) && ( $( '#replyrow' ).parent().is('#com-reply') || window.confirm( __( 'Are you sure you want to edit this comment?\nThe changes you made will be lost.' ) ) ) ) { 850 853 $( el ).find( 'button.vim-q' ).click(); 851 854 } … … 1008 1011 1009 1012 if ( c.hasClass('unapproved') ) { 1010 replyButton.text( adminCommentsL10n.replyApprove);1013 replyButton.text( __( 'Approve and Reply' ) ); 1011 1014 } else { 1012 replyButton.text( adminCommentsL10n.reply);1015 replyButton.text( __( 'Reply' ) ); 1013 1016 } 1014 1017 … … 1218 1221 } 1219 1222 1220 return window.confirm( adminCommentsL10n.warnCommentChanges);1223 return window.confirm( __( 'Are you sure you want to do this?\nThe comment changes you made will be lost.' ) ); 1221 1224 } 1222 1225 }; … … 1313 1316 ], 1314 1317 { 1315 highlight_first: adminComments L10n.hotkeys_highlight_first,1316 highlight_last: adminComments L10n.hotkeys_highlight_last,1318 highlight_first: adminCommentsSettings.hotkeys_highlight_first, 1319 highlight_last: adminCommentsSettings.hotkeys_highlight_last, 1317 1320 prev_page_link_cb: make_hotkeys_redirect('prev'), 1318 1321 next_page_link_cb: make_hotkeys_redirect('next'), -
trunk/src/wp-includes/script-loader.php
r48347 r48348 1197 1197 1198 1198 $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array( 'wp-lists', 'quicktags', 'jquery-query' ), false, 1 ); 1199 $scripts->set_translations( 'admin-comments' ); 1199 1200 did_action( 'init' ) && $scripts->localize( 1200 1201 'admin-comments', 1201 'adminComments L10n',1202 'adminCommentsSettings', 1202 1203 array( 1203 1204 'hotkeys_highlight_first' => isset( $_GET['hotkeys_highlight_first'] ), 1204 1205 'hotkeys_highlight_last' => isset( $_GET['hotkeys_highlight_last'] ), 1205 'replyApprove' => __( 'Approve and Reply' ),1206 'reply' => __( 'Reply' ),1207 'warnQuickEdit' => __( "Are you sure you want to edit this comment?\nThe changes you made will be lost." ),1208 'warnCommentChanges' => __( "Are you sure you want to do this?\nThe comment changes you made will be lost." ),1209 'docTitleComments' => __( 'Comments' ),1210 /* translators: %s: Comments count. */1211 'docTitleCommentsCount' => __( 'Comments (%s)' ),1212 1206 ) 1213 1207 );
Note: See TracChangeset
for help on using the changeset viewer.