Changeset 16073 for trunk/wp-includes/l10n.php
- Timestamp:
- 10/29/2010 01:12:14 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/l10n.php
r15590 r16073 268 268 * ... 269 269 * $message = $messages[$type]; 270 * $usable_text = sprintf( _n($message[0], $message[1], $count), $count);270 * $usable_text = sprintf( translate_nooped_plural( $message, $count ), $count ); 271 271 * 272 272 * @since 2.5 … … 275 275 * @return array array($single, $plural) 276 276 */ 277 function _n_noop( $sing le, $plural ) {278 return array( $single, $plural );277 function _n_noop( $singular, $plural ) { 278 return array( 'singular' => $singular, 'plural' => $plural, 'context' => null ); 279 279 } 280 280 … … 284 284 * @see _n_noop() 285 285 */ 286 function _nx_noop( $single, $plural, $context ) { 287 return array( $single, $plural, $context ); 286 function _nx_noop( $singular, $plural, $context ) { 287 return array( 'singular' => $singular, 'plural' => $plural, 'context' => $context ); 288 } 289 290 /** 291 * Translate the result of _n_noop() or _nx_noop() 292 * 293 * @since 3.1 294 * @param array $nooped_plural array with singular, plural and context keys, usually the result of _n_noop() or _nx_noop() 295 * @param int $count number of objects 296 * @param string $domain Optional. The domain identifier the text should be retrieved in 297 */ 298 function translate_nooped_plural( $nooped_plural, $count, $domain = 'default' ) { 299 if ( $nooped_plural['context'] ) 300 return _nx( $nooped_plural['singular'], $nooped_plural['plural'], $count, $nooped_plural['context'], $domain ); 301 else 302 return _n( $nooped_plural['singular'], $nooped_plural['plural'], $count, $domain ); 288 303 } 289 304
Note: See TracChangeset
for help on using the changeset viewer.