Make WordPress Core

Ticket #48244: 48244.2021091300.patch

File 48244.2021091300.patch, 5.9 KB (added by rsiddharth, 5 years ago)

Patch version 2021091300 - addresses issues pointed out by @swissspidy 

  • src/js/_enqueues/admin/common.js

     
    354354window.setPostThumbnailL10n = deprecateL10nObject( 'setPostThumbnailL10n', window.setPostThumbnailL10n, '5.5.0' );
    355355
    356356/**
     357 * Removed in 5.9.0, needed for back-compatibility.
     358 *
     359 * @since 3.9.12
     360 * @deprecated 5.9.0
     361 */
     362window.uiAutocompleteL10n = window.uiAutocompleteL10n || {
     363        noResults: '',
     364        oneResult: '',
     365        manyResults: '',
     366        itemSelected: ''
     367};
     368
     369window.uiAutocompleteL10n = deprecateL10nObject( 'uiAutocompleteL10n', window.uiAutocompleteL10n, '5.9.0' );
     370
     371/**
    357372 * Removed in 3.3.0, needed for back-compatibility.
    358373 *
    359374 * @since 2.7.0
  • 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                                        /* translators: %d: Number of results found when using jQuery UI Autocomplete. */
     143                                        return sprintf( _n( '%d result found. Use up and down arrow keys to navigate.',
     144                                                            '%d results found. Use up and down arrow keys to navigate.',
     145                                                            number ),
     146                                                        number );
    148147                                }
    149148                        }
    150149                }, 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                                                                /* translators: %d: Number of results found when using jQuery UI Autocomplete. */
     466                                                                return sprintf( _n( '%d result found. Use up and down arrow keys to navigate.',
     467                                                                                    '%d results found. Use up and down arrow keys to navigate.',
     468                                                                                    number ),
     469                                                                                number );
    469470                                                        }
    470471                                                }
    471472                                        } ).autocomplete( 'instance' )._renderItem = function( ul, item ) {
  • src/wp-includes/script-loader.php

     
    806806        $scripts->add( 'jquery-ui-position', false, array( 'jquery-ui-core' ), '1.13.0-rc.2', 1 );
    807807        $scripts->add( 'jquery-ui-widget', false, array( 'jquery-ui-core' ), '1.13.0-rc.2', 1 );
    808808
    809         // Strings for 'jquery-ui-autocomplete' live region messages.
    810         did_action( 'init' ) && $scripts->localize(
    811                 'jquery-ui-autocomplete',
    812                 'uiAutocompleteL10n',
    813                 array(
    814                         'noResults'    => __( 'No results found.' ),
    815                         /* translators: Number of results found when using jQuery UI Autocomplete. */
    816                         'oneResult'    => __( '1 result found. Use up and down arrow keys to navigate.' ),
    817                         /* translators: %d: Number of results found when using jQuery UI Autocomplete. */
    818                         'manyResults'  => __( '%d results found. Use up and down arrow keys to navigate.' ),
    819                         'itemSelected' => __( 'Item selected.' ),
    820                 )
    821         );
    822 
    823809        // Deprecated, not used in core, most functionality is included in jQuery 1.3.
    824810        $scripts->add( 'jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array( 'jquery' ), '4.3.0', 1 );
    825811
     
    11101096
    11111097        $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array( 'hoverintent-js' ), false, 1 );
    11121098
    1113         $scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wp-a11y' ), false, 1 );
     1099        $scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wp-a11y', 'wp-i18n' ), false, 1 );
    11141100        did_action( 'init' ) && $scripts->localize(
    11151101                'wplink',
    11161102                'wpLinkL10n',
     
    12751261                $scripts->add( 'tags-box', "/wp-admin/js/tags-box$suffix.js", array( 'jquery', 'tags-suggest' ), false, 1 );
    12761262                $scripts->set_translations( 'tags-box' );
    12771263
    1278                 $scripts->add( 'tags-suggest', "/wp-admin/js/tags-suggest$suffix.js", array( 'jquery-ui-autocomplete', 'wp-a11y' ), false, 1 );
     1264                $scripts->add( 'tags-suggest', "/wp-admin/js/tags-suggest$suffix.js", array( 'jquery-ui-autocomplete', 'wp-a11y', 'wp-i18n' ), false, 1 );
    12791265                $scripts->set_translations( 'tags-suggest' );
    12801266
    12811267                $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 );