WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/ n noop

Contents

Description

Register plural strings in POT file, but don't translate them.

Used when you want to keep structures with translatable plural strings and use them later.

Usage

<?php _n_noop$singular$plural$domain ?>

Parameters

$singular
(string) (required) Single form to be i18ned
Default: None
$plural
(string) (required) Plural form to be i18ned
Default: None
$domain
(string) (optional) The domain identifier the text will be retrieved in
Default: null

Return Values

(array) 
array
array(
    0          =>  $singular,
    1          =>  $plural,
    'singular' =>  $singular,
    'plural'   =>  $plural,
    'context'  =>  null,
    'domain'   =>  $domain
)

Examples

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


Notes

This function replaces __ngettext_noop which was deprecated

Change Log

Source File

_n_noop() 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.