WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/translate nooped plural

Description

Translate the result of _n_noop() or _nx_noop()

Usage

<?php translate_nooped_plural$nooped_plural$count$domain ?>

Parameters

$nooped_plural
(array) (required) Array with singular, plural and context keys, usually the result of _n_noop() or _nx_noop()
Default: None
$count
(integer) (required) Number of objects
Default: None
$domain
(string) (optional) The domain identifier the text should be retrieved in
Default: 'default'

Return Values

(string) 
Either $singular or $plural translated (context) string

Examples

$messages = array(
	'post' => _n_noop('%s post', '%s posts'),
	'page' => _n_noop('%s page', '%s pages')
);
...
$message = $messages[$type];
$usable_text = sprintf( translate_nooped_plural( $message, $count, $domain ), $count );

Notes

Change Log

Source File

translate_nooped_plural() is located in /wp-includes/l10n.php.

Related

L10n: translate(), __(), _e(), _n(), _x(), _ex(), _nx(), esc_attr__(), esc_attr_e(), esc_attr_x(), esc_html__(), esc_html_e(), esc_html_x(), _n_noop(), _nx_noop(), translate_nooped_plural()

See also index of Function Reference and index of Template Tags.