Changeset 16073
- Timestamp:
- 10/29/2010 01:12:14 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/list-table-comments.php
r16061 r16073 150 150 */ 151 151 $status_links[$status] = "<li class='$status'><a href='$link'$class>" . sprintf( 152 _n( $label[0], $label[1], $num_comments->$status ),152 translate_nooped_plural( $label, $num_comments->$status ), 153 153 number_format_i18n( $num_comments->$status ) 154 154 ) . '</a>'; -
trunk/wp-admin/includes/list-table-media.php
r16061 r16073 68 68 $class = ' class="current"'; 69 69 if ( !empty( $num_posts[$mime_type] ) ) 70 $type_links[$mime_type] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';70 $type_links[$mime_type] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>'; 71 71 } 72 72 $type_links['detached'] = '<li><a href="upload.php?detached=1"' . ( $detached ? ' class="current"' : '' ) . '>' . sprintf( _nx( 'Unattached <span class="count">(%s)</span>', 'Unattached <span class="count">(%s)</span>', $total_orphans, 'detached files' ), number_format_i18n( $total_orphans ) ) . '</a>'; -
trunk/wp-admin/includes/list-table-posts.php
r16061 r16073 171 171 $class = ' class="current"'; 172 172 173 $status_links[$status_name] = "<li><a href='edit.php?post_status=$status_name&post_type=$post_type'$class>" . sprintf( _n( $status->label_count[0], $status->label_count[1], $num_posts->$status_name ), number_format_i18n( $num_posts->$status_name ) ) . '</a>';173 $status_links[$status_name] = "<li><a href='edit.php?post_status=$status_name&post_type=$post_type'$class>" . sprintf( translate_nooped_plural( $status->label_count, $num_posts->$status_name ), number_format_i18n( $num_posts->$status_name ) ) . '</a>'; 174 174 } 175 175 -
trunk/wp-admin/includes/media.php
r16061 r16073 1864 1864 $class = ' class="current"'; 1865 1865 1866 $type_links[] = "<li><a href='" . esc_url(add_query_arg(array('post_mime_type'=>$mime_type, 'paged'=>false))) . "'$class>" . sprintf( _n($label[2][0], $label[2][1], $num_posts[$mime_type]), "<span id='$mime_type-counter'>" . number_format_i18n( $num_posts[$mime_type] ) . '</span>') . '</a>';1866 $type_links[] = "<li><a href='" . esc_url(add_query_arg(array('post_mime_type'=>$mime_type, 'paged'=>false))) . "'$class>" . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type] ), "<span id='$mime_type-counter'>" . number_format_i18n( $num_posts[$mime_type] ) . '</span>') . '</a>'; 1867 1867 } 1868 1868 echo implode(' | </li>', apply_filters( 'media_upload_mime_type_links', $type_links ) ) . '</li>'; -
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.