WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/13/2017 07:07:55 AM (3 years ago)
Author:
westonruter
Message:

I18N: Fix passing singular/plural strings to JS.

This is a temporary solution while waiting for full I18N support in JS.

Props ocean90, dd32, westonruter, Mirucon for testing.
Amends [41376], [41721], [41389],
See #20491.
Fixes #42510 for trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets/class-wp-widget-custom-html.php

    r41640 r42163  
    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        );
Note: See TracChangeset for help on using the changeset viewer.