Codex tools: Log in
Retrieve the plural or single form based on the amount.
If the domain is not set in the $l10n list, then a comparison will be made and either $plural or $single parameters returned.
If the domain does exist, then the parameters $single, $plural, and $number will first be passed to the domain's ngettext() method. Then it will be passed to the 'ngettext' filter hook along with the same parameters. The expected type will be a string.
<?php _n( $single, $plural, $number, $domain ) ?>
Display either "1 star" or "x stars" for a star rating plugin.
$rating = '3'; $text = sprintf( _n( '1 star', '%s stars', $rating, 'appthemes' ), $rating ); // "3 stars" echo $text;
Example from /wp-admin/edit-comments.php without the use of a text domain for translation.
if ( $approved > 0 ) $messages = sprintf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
_n() is located in