Make WordPress Core

Ticket #42510: 42510.2.diff

File 42510.2.diff, 5.0 KB (added by westonruter, 7 years ago)
  • src/wp-includes/script-loader.php

    diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
    index e5204a7aa0..cc401f6925 100644
    function wp_default_scripts( &$scripts ) { 
    476476        did_action( 'init' ) && $scripts->add_inline_script( 'wp-theme-plugin-editor', sprintf( 'wp.themePluginEditor.l10n = %s;', wp_json_encode( array(
    477477                'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
    478478                'saveError' => __( 'Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.' ),
    479                 'lintError' => wp_array_slice_assoc(
     479                'lintError' => array(
    480480                        /* translators: %d: error count */
    481                         _n_noop( 'There is %d error which must be fixed before you can update this file.', 'There are %d errors which must be fixed before you can update this file.' ),
    482                         array( 'singular', 'plural' )
     481                        'singular' => _n( 'There is %d error which must be fixed before you can update this file.', 'There are %d errors which must be fixed before you can update this file.', 1 ),
     482                        /* translators: %d: error count */
     483                        'plural' => _n( 'There is %d error which must be fixed before you can update this file.', 'There are %d errors which must be fixed before you can update this file.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
    483484                ),
    484485        ) ) ) );
    485486
    function wp_default_scripts( &$scripts ) { 
    580581                'videoHeaderNotice'  => __( 'This theme doesn’t support video headers on this page. Navigate to the front page or another page that supports video headers.' ),
    581582                // Used for overriding the file types allowed in plupload.
    582583                'allowedFiles'       => __( 'Allowed Files' ),
    583                 'customCssError'     => wp_array_slice_assoc(
     584                'customCssError'     => array(
     585                        /* translators: %d: error count */
     586                        '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 ),
    584587                        /* translators: %d: error count */
    585                         _n_noop( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.' ),
    586                         array( 'singular', 'plural' )
     588                        '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 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
    587589                ),
    588590                'pageOnFrontError' => __( 'Homepage and posts page must be different.' ),
    589                 'saveBlockedError' => wp_array_slice_assoc(
     591                'saveBlockedError' => array(
     592                        /* translators: %s: number of invalid settings */
     593                        'singular' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 1 ),
    590594                        /* translators: %s: number of invalid settings */
    591                         _n_noop( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.' ),
    592                         array( 'singular', 'plural' )
     595                        'plural'   => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
    593596                ),
    594597                'scheduleDescription' => __( 'Schedule your customization changes to publish ("go live") at a future date.' ),
    595598                'themePreviewUnavailable' => __( 'Sorry, you can’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.' ),
  • src/wp-includes/widgets/class-wp-widget-custom-html.php

    diff --git src/wp-includes/widgets/class-wp-widget-custom-html.php src/wp-includes/widgets/class-wp-widget-custom-html.php
    index a75e264479..855c3c5895 100644
    class WP_Widget_Custom_HTML extends WP_Widget { 
    175175                wp_add_inline_script( 'custom-html-widgets', sprintf( 'wp.customHtmlWidgets.init( %s );', wp_json_encode( $settings ) ), 'after' );
    176176
    177177                $l10n = array(
    178                         'errorNotice' => wp_array_slice_assoc(
     178                        'errorNotice' => array(
    179179                                /* translators: %d: error count */
    180                                 _n_noop( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.' ),
    181                                 array( 'singular', 'plural' )
     180                                '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 ),
     181                                /* translators: %d: error count */
     182                                '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 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
    182183                        ),
    183184                );
    184185                wp_add_inline_script( 'custom-html-widgets', sprintf( 'jQuery.extend( wp.customHtmlWidgets.l10n, %s );', wp_json_encode( $l10n ) ), 'after' );