Make WordPress Core

Changeset 35615


Ignore:
Timestamp:
11/11/2015 08:59:56 PM (11 years ago)
Author:
ocean90
Message:

Comments: Dynamically update the document title text for all languages, not only English.

See [33821].
Fixes #33414.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/edit-comments.js

    r34977 r35615  
    9999                var newTitle, regExMatch, titleCount, commentFrag;
    100100
    101                 titleRegEx = titleRegEx || new RegExp( 'Comments (\\([0-9' + thousandsSeparator + ']+\\))?' );
     101                titleRegEx = titleRegEx || new RegExp( adminCommentsL10n.docTitleCommentsCount.replace( '%s', '\\([0-9' + thousandsSeparator + ']+\\)' ) + '?' );
    102102                // count funcs operate on a $'d element
    103103                titleDiv = titleDiv || $( '<div />' );
     
    118118                        regExMatch = titleRegEx.exec( document.title );
    119119                        if ( regExMatch ) {
    120                                 newTitle = document.title.replace( regExMatch[0], 'Comments (' + titleDiv.text() + ') ' );
     120                                newTitle = document.title.replace( regExMatch[0], adminCommentsL10n.docTitleCommentsCount.replace( '%s', titleDiv.text() ) + ' ' );
    121121                        }
    122122                } else {
    123123                        regExMatch = titleRegEx.exec( newTitle );
    124124                        if ( regExMatch ) {
    125                                 newTitle = newTitle.replace( regExMatch[0], 'Comments' );
     125                                newTitle = newTitle.replace( regExMatch[0], adminCommentsL10n.docTitleComments );
    126126                        }
    127127                }
  • trunk/src/wp-includes/script-loader.php

    r35605 r35615  
    488488                        'reply' => __( 'Reply' ),
    489489                        'warnQuickEdit' => __( "Are you sure you want to edit this comment?\nThe changes you made will be lost." ),
     490                        'docTitleComments' => __( 'Comments' ),
     491                        /* translators: %s: comments count */
     492                        'docTitleCommentsCount' => __( 'Comments (%s)' ),
    490493                ) );
    491494
Note: See TracChangeset for help on using the changeset viewer.