diff --git a/src/wp-admin/js/edit-comments.js b/src/wp-admin/js/edit-comments.js index 23228af15f..7fc62deb73 100644 --- a/src/wp-admin/js/edit-comments.js +++ b/src/wp-admin/js/edit-comments.js @@ -98,7 +98,7 @@ var getCount, updateCount, updateCountText, updatePending, updateApproved, updateHtmlTitle = function ( diff ) { var newTitle, regExMatch, titleCount, commentFrag; - titleRegEx = titleRegEx || new RegExp( 'Comments (\\([0-9' + thousandsSeparator + ']+\\))?' ); + titleRegEx = titleRegEx || new RegExp( adminCommentsL10n.docTitleCommentsCount.replace( '%s', '\\([0-9' + thousandsSeparator + ']+\\)' ) + '?' ); // count funcs operate on a $'d element titleDiv = titleDiv || $( '
' ); newTitle = adminTitle; @@ -117,12 +117,12 @@ var getCount, updateCount, updateCountText, updatePending, updateApproved, updateCount( titleDiv, titleCount ); regExMatch = titleRegEx.exec( document.title ); if ( regExMatch ) { - newTitle = document.title.replace( regExMatch[0], 'Comments (' + titleDiv.text() + ') ' ); + newTitle = document.title.replace( regExMatch[0], adminCommentsL10n.docTitleCommentsCount.replace( '%s', titleDiv.text() ) + ' ' ); } } else { regExMatch = titleRegEx.exec( newTitle ); if ( regExMatch ) { - newTitle = newTitle.replace( regExMatch[0], 'Comments' ); + newTitle = newTitle.replace( regExMatch[0], adminCommentsL10n.docTitleComments ); } } document.title = newTitle; diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 971012a9a4..5288896a3b 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -487,6 +487,9 @@ function wp_default_scripts( &$scripts ) { 'replyApprove' => __( 'Approve and Reply' ), 'reply' => __( 'Reply' ), 'warnQuickEdit' => __( "Are you sure you want to edit this comment?\nThe changes you made will be lost." ), + 'docTitleComments' => __( 'Comments' ), + /* translators: %s: comments count */ + 'docTitleCommentsCount' => __( 'Comments (%s)' ), ) ); $scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", array('jquery'), false, 1 );