WordPress.org

Make WordPress Core

Ticket #20188: 20188.diff

File 20188.diff, 1.5 KB (added by nacin, 6 years ago)
  • wp-includes/l10n.php

     
    274274 * @param string $plural Plural form to be i18ned
    275275 * @return array array($singular, $plural)
    276276 */
    277 function _n_noop( $singular, $plural ) {
    278         return array( 0 => $singular, 1 => $plural, 'singular' => $singular, 'plural' => $plural, 'context' => null );
     277function _n_noop( $singular, $plural, $domain = null ) {
     278        return array( 0 => $singular, 1 => $plural, 'singular' => $singular, 'plural' => $plural, 'context' => null, 'domain' => $domain );
    279279}
    280280
    281281/**
     
    283283 *
    284284 * @see _n_noop()
    285285 */
    286 function _nx_noop( $singular, $plural, $context ) {
    287         return array( 0 => $singular, 1 => $plural, 2 => $context, 'singular' => $singular, 'plural' => $plural, 'context' => $context );
     286function _nx_noop( $singular, $plural, $context, $domain = null ) {
     287        return array( 0 => $singular, 1 => $plural, 2 => $context, 'singular' => $singular, 'plural' => $plural, 'context' => $context, 'domain' => $domain );
    288288}
    289289
    290290/**
     
    296296 * @param string $domain Optional. The domain identifier the text should be retrieved in
    297297 */
    298298function translate_nooped_plural( $nooped_plural, $count, $domain = 'default' ) {
     299        if ( $nooped_plural['domain'] )
     300                $domain = $nooped_plural['domain'];
     301
    299302        if ( $nooped_plural['context'] )
    300303                return _nx( $nooped_plural['singular'], $nooped_plural['plural'], $count, $nooped_plural['context'], $domain );
    301304        else