Make WordPress Core

Ticket #48244: 48244.2021091100.patch

File 48244.2021091100.patch, 4.0 KB (added by rsiddharth, 5 years ago)

Initial version (2021091100).

  • src/js/_enqueues/admin/tags-suggest.js

     
    44 * @output wp-admin/js/tags-suggest.js
    55 */
    66( function( $ ) {
    7         if ( typeof window.uiAutocompleteL10n === 'undefined' ) {
    8                 return;
    9         }
    10 
    117        var tempID = 0;
    128        var separator = wp.i18n._x( ',', 'tag delimiter' ) || ',';
     9        var __ = wp.i18n.__,
     10            _n = wp.i18n._n,
     11            sprintf = wp.i18n.sprintf;
    1312
    1413        function split( val ) {
    1514                return val.split( new RegExp( separator + '\\s*' ) );
     
    138137                                collision: 'none'
    139138                        },
    140139                        messages: {
    141                                 noResults: window.uiAutocompleteL10n.noResults,
     140                                noResults: __( 'No results found.' ),
    142141                                results: function( number ) {
    143                                         if ( number > 1 ) {
    144                                                 return window.uiAutocompleteL10n.manyResults.replace( '%d', number );
    145                                         }
    146 
    147                                         return window.uiAutocompleteL10n.oneResult;
     142                                        return sprintf( _n( '%d result found. Use up and down arrow keys to navigate.',
     143                                                             '%d results found. Use up and down arrow keys to navigate.',
     144                                                             number ),
     145                                                        number );
    148146                                }
    149147                        }
    150148                }, options );
  • src/js/_enqueues/vendor/tinymce/plugins/wplink/plugin.js

     
    9898                var urlRegex2 = /^https?:\/\/[^\/]+\.[^\/]+($|\/)/i;
    9999                var speak = ( typeof window.wp !== 'undefined' && window.wp.a11y && window.wp.a11y.speak ) ? window.wp.a11y.speak : function() {};
    100100                var hasLinkError = false;
     101                var __ = window.wp.i18n.__;
     102                var _n = window.wp.i18n._n;
     103                var sprintf = window.wp.i18n.sprintf;
    101104
    102105                function getSelectedLink() {
    103106                        var href, html,
     
    457460                                                        my: 'left top+2'
    458461                                                },
    459462                                                messages: {
    460                                                         noResults: ( typeof window.uiAutocompleteL10n !== 'undefined' ) ? window.uiAutocompleteL10n.noResults : '',
     463                                                        noResults: __( 'No results found.' ) ,
    461464                                                        results: function( number ) {
    462                                                                 if ( typeof window.uiAutocompleteL10n !== 'undefined' ) {
    463                                                                         if ( number > 1 ) {
    464                                                                                 return window.uiAutocompleteL10n.manyResults.replace( '%d', number );
    465                                                                         }
    466 
    467                                                                         return window.uiAutocompleteL10n.oneResult;
    468                                                                 }
     465                                                                return sprintf( _n( '%d result found. Use up and down arrow keys to navigate.',
     466                                                                                    '%d results found. Use up and down arrow keys to navigate.',
     467                                                                                    number ),
     468                                                                                number );
    469469                                                        }
    470470                                                }
    471471                                        } ).autocomplete( 'instance' )._renderItem = function( ul, item ) {
  • src/wp-includes/script-loader.php

     
    11101110
    11111111        $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array( 'hoverintent-js' ), false, 1 );
    11121112
    1113         $scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wp-a11y' ), false, 1 );
     1113        $scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wp-a11y', 'wp-i18n' ), false, 1 );
    11141114        did_action( 'init' ) && $scripts->localize(
    11151115                'wplink',
    11161116                'wpLinkL10n',
     
    12751275                $scripts->add( 'tags-box', "/wp-admin/js/tags-box$suffix.js", array( 'jquery', 'tags-suggest' ), false, 1 );
    12761276                $scripts->set_translations( 'tags-box' );
    12771277
    1278                 $scripts->add( 'tags-suggest', "/wp-admin/js/tags-suggest$suffix.js", array( 'jquery-ui-autocomplete', 'wp-a11y' ), false, 1 );
     1278                $scripts->add( 'tags-suggest', "/wp-admin/js/tags-suggest$suffix.js", array( 'jquery-ui-autocomplete', 'wp-a11y', 'wp-i18n' ), false, 1 );
    12791279                $scripts->set_translations( 'tags-suggest' );
    12801280
    12811281                $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array( 'suggest', 'wp-lists', 'postbox', 'tags-box', 'underscore', 'word-count', 'wp-a11y', 'wp-sanitize', 'clipboard' ), false, 1 );