Make WordPress Core

Ticket #42140: 42140.3.diff

File 42140.3.diff, 9.9 KB (added by hellofromTonya, 4 years ago)

Refreshes 42140.2.dff to the latest version of wordpress-develop's master branch.

  • src/js/_enqueues/wp/customize/controls.js

    diff --git a/src/js/_enqueues/wp/customize/controls.js b/src/js/_enqueues/wp/customize/controls.js
    index 484ac5a49b..164d308c83 100644
    a b  
    21192119                                                        }
    21202120                                                });
    21212121                                                if ( 'local' !== section.params.filter_type ) {
    2122                                                         wp.a11y.speak( api.settings.l10n.themeSearchResults.replace( '%d', data.info.results ) );
     2122                                                        wp.a11y.speak(
     2123                                                                wp.i18n.sprintf( wp.i18n._n( '%d theme found', '%d themes found', data.info.results ), data.info.results )
     2124                                                        );
    21232125                                                }
    21242126                                        }
    21252127
     
    24262428                 * @return {void}
    24272429                 */
    24282430                updateCount: function( count ) {
    2429                         var section = this, countEl, displayed;
     2431                        var section = this, i18n = wp.i18n, countEl, countText, displayed;
    24302432
    24312433                        if ( ! count && 0 !== count ) {
    24322434                                count = section.getVisibleCount();
     
    24342436
    24352437                        displayed = section.contentContainer.find( '.themes-displayed' );
    24362438                        countEl = section.contentContainer.find( '.theme-count' );
     2439                        countText = i18n.sprintf( i18n._n( '%s theme', '%s themes', count ), count );
    24372440
    24382441                        if ( 0 === count ) {
    2439                                 countEl.text( '0' );
     2442                                countEl.text( countText );
    24402443                        } else {
    24412444
    24422445                                // Animate the count change for emphasis.
    24432446                                displayed.fadeOut( 180, function() {
    2444                                         countEl.text( count );
     2447                                        countEl.text( countText );
    24452448                                        displayed.fadeIn( 180 );
    24462449                                } );
    2447                                 wp.a11y.speak( api.settings.l10n.announceThemeCount.replace( '%d', count ) );
     2450                                wp.a11y.speak(
     2451                                        i18n.sprintf( i18n._n( 'Displaying %d theme', 'Displaying %d themes', count ), count )
     2452                                );
    24482453                        }
    24492454                },
    24502455
     
    54885493                        control.setting.notifications.remove( 'csslint_error' );
    54895494
    54905495                        if ( 0 !== errorAnnotations.length ) {
    5491                                 if ( 1 === errorAnnotations.length ) {
    5492                                         message = api.l10n.customCssError.singular.replace( '%d', '1' );
    5493                                 } else {
    5494                                         message = api.l10n.customCssError.plural.replace( '%d', String( errorAnnotations.length ) );
    5495                                 }
     5496                                message = wp.i18n.sprintf(
     5497                                        wp.i18n._n(
     5498                                                'There is %d error which must be fixed before you can save.',
     5499                                                'There are %d errors which must be fixed before you can save.',
     5500                                                errorAnnotations.length
     5501                                        ),
     5502                                        errorAnnotations.length
     5503                                )
     5504
    54965505                                control.setting.notifications.add( new api.Notification( 'csslint_error', {
    54975506                                        message: message,
    54985507                                        type: 'error'
     
    75157524
    75167525                                                if ( invalidSettings.length ) {
    75177526                                                        api.notifications.add( new api.Notification( errorCode, {
    7518                                                                 message: ( 1 === invalidSettings.length ? api.l10n.saveBlockedError.singular : api.l10n.saveBlockedError.plural ).replace( /%s/g, String( invalidSettings.length ) ),
     7527                                                                message: wp.i18n.sprintf(
     7528                                                                        wp.i18n._n(
     7529                                                                                'Unable to save due to %s invalid setting.',
     7530                                                                                'Unable to save due to %s invalid settings.',
     7531                                                                                invalidSettings.length
     7532                                                                        ),
     7533                                                                        invalidSettings.length
     7534                                                                ),
    75197535                                                                type: 'error',
    75207536                                                                dismissible: true,
    75217537                                                                saveFailure: true
  • src/wp-includes/class-wp-customize-manager.php

    diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php
    index a46b97fa5a..638cfcfc64 100644
    a b final class WP_Customize_Manager { 
    49014901                        'previewableDevices'     => $this->get_previewable_devices(),
    49024902                        'l10n'                   => array(
    49034903                                'confirmDeleteTheme'   => __( 'Are you sure you want to delete this theme?' ),
    4904                                 /* translators: %d: Number of theme search results, which cannot currently consider singular vs. plural forms. */
    4905                                 'themeSearchResults'   => __( '%d themes found' ),
    4906                                 /* translators: %d: Number of themes being displayed, which cannot currently consider singular vs. plural forms. */
    4907                                 'announceThemeCount'   => __( 'Displaying %d themes' ),
    49084904                                /* translators: %s: Theme name. */
    49094905                                'announceThemeDetails' => __( 'Showing details for theme: %s' ),
    49104906                        ),
    49114907                );
    49124908
     4909                // These strings are here for backwards compatibility; the translations now occur in JavaScript.
     4910                /* translators: %d: Number of theme search results. Note there is a newer translation of this string with singular and plural forms. */
     4911                $settings['l10n']['themeSearchResults'] = __( '%d themes found' );
     4912                /* translators: %d: Number of themes being displayed. Note there is a newer translation of this string with singular and plural forms. */
     4913                $settings['l10n']['announceThemeCount'] = __( 'Displaying %d themes' );
     4914
    49134915                // Temporarily disable installation in Customizer. See #42184.
    49144916                $filesystem_method = get_filesystem_method();
    49154917                ob_start();
  • src/wp-includes/customize/class-wp-customize-themes-section.php

    diff --git a/src/wp-includes/customize/class-wp-customize-themes-section.php b/src/wp-includes/customize/class-wp-customize-themes-section.php
    index 75e57398ab..854d82af6f 100644
    a b class WP_Customize_Themes_Section extends WP_Customize_Section { 
    149149                        <span class="themes-displayed">
    150150                                <?php
    151151                                /* translators: %s: Number of themes displayed. */
    152                                 printf( __( '%s themes' ), '<span class="theme-count">0</span>' );
     152                                printf( _n( '%s theme', '%s themes', '<span class="theme-count">0</span>' ), '<span class="theme-count">0</span>' );
    153153                                ?>
    154154                        </span>
    155155                </div>
  • src/wp-includes/script-loader.php

    diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
    index be95eee4cb..034caaf1ec 100644
    a b function wp_default_scripts( $scripts ) { 
    11151115        $scripts->add( 'customize-preview', "/wp-includes/js/customize-preview$suffix.js", array( 'wp-a11y', 'customize-base' ), false, 1 );
    11161116        $scripts->add( 'customize-models', '/wp-includes/js/customize-models.js', array( 'underscore', 'backbone' ), false, 1 );
    11171117        $scripts->add( 'customize-views', '/wp-includes/js/customize-views.js', array( 'jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views' ), false, 1 );
    1118         $scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y', 'wp-util', 'jquery-ui-core' ), false, 1 );
     1118        $scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y', 'wp-i18n', 'wp-util', 'jquery-ui-core' ), false, 1 );
    11191119        did_action( 'init' ) && $scripts->localize(
    11201120                'customize-controls',
    11211121                '_wpCustomizeControlsL10n',
    function wp_default_scripts( $scripts ) { 
    11581158                        'videoHeaderNotice'       => __( 'This theme doesn&#8217;t support video headers on this page. Navigate to the front page or another page that supports video headers.' ),
    11591159                        // Used for overriding the file types allowed in Plupload.
    11601160                        'allowedFiles'            => __( 'Allowed Files' ),
     1161                        'pageOnFrontError'        => __( 'Homepage and posts page must be different.' ),
     1162                        'scheduleDescription'     => __( 'Schedule your customization changes to publish ("go live") at a future date.' ),
     1163                        'themePreviewUnavailable' => __( 'Sorry, you can&#8217;t preview new themes when you have changes scheduled or saved as a draft. Please publish your changes, or wait until they publish to preview new themes.' ),
     1164                        'themeInstallUnavailable' => sprintf(
     1165                                /* translators: %s: URL to Add Themes admin screen. */
     1166                                __( 'You won&#8217;t be able to install new themes from here yet since your install requires SFTP credentials. For now, please <a href="%s">add themes in the admin</a>.' ),
     1167                                esc_url( admin_url( 'theme-install.php' ) )
     1168                        ),
     1169                        'publishSettings'         => __( 'Publish Settings' ),
     1170                        'invalidDate'             => __( 'Invalid date.' ),
     1171                        'invalidValue'            => __( 'Invalid value.' ),
     1172                        // These strings are here for backward compatibility; the translations now occurs in JavaScript.
    11611173                        'customCssError'          => array(
    11621174                                /* translators: %d: Error count. */
    11631175                                'singular' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 1 ),
    11641176                                /* translators: %d: Error count. */
    11651177                                'plural'   => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 2 ),
    1166                                 // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
    11671178                        ),
    1168                         'pageOnFrontError'        => __( 'Homepage and posts page must be different.' ),
    11691179                        'saveBlockedError'        => array(
    11701180                                /* translators: %s: Number of invalid settings. */
    11711181                                'singular' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 1 ),
    11721182                                /* translators: %s: Number of invalid settings. */
    11731183                                'plural'   => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 2 ),
    1174                                 // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
    11751184                        ),
    1176                         'scheduleDescription'     => __( 'Schedule your customization changes to publish ("go live") at a future date.' ),
    1177                         'themePreviewUnavailable' => __( 'Sorry, you can&#8217;t preview new themes when you have changes scheduled or saved as a draft. Please publish your changes, or wait until they publish to preview new themes.' ),
    1178                         'themeInstallUnavailable' => sprintf(
    1179                                 /* translators: %s: URL to Add Themes admin screen. */
    1180                                 __( 'You won&#8217;t be able to install new themes from here yet since your install requires SFTP credentials. For now, please <a href="%s">add themes in the admin</a>.' ),
    1181                                 esc_url( admin_url( 'theme-install.php' ) )
    1182                         ),
    1183                         'publishSettings'         => __( 'Publish Settings' ),
    1184                         'invalidDate'             => __( 'Invalid date.' ),
    1185                         'invalidValue'            => __( 'Invalid value.' ),
    11861185                )
    11871186        );
    11881187        $scripts->add( 'customize-selective-refresh', "/wp-includes/js/customize-selective-refresh$suffix.js", array( 'jquery', 'wp-util', 'customize-preview' ), false, 1 );