ngettext_with_context
Filters the singular or plural form of a string with gettext context.
Usage
add_filter( 'ngettext_with_context', 'wp_kama_ngettext_with_context_filter', 10, 6 ); /** * Function for `ngettext_with_context` filter-hook. * * @param string $translation Translated text. * @param string $single The text to be used if the number is singular. * @param string $plural The text to be used if the number is plural. * @param int $number The number to compare against to use either the singular or plural form. * @param string $context Context information for the translators. * @param string $domain Text domain. Unique identifier for retrieving translated strings. * * @return string */ function wp_kama_ngettext_with_context_filter( $translation, $single, $plural, $number, $context, $domain ){ // filter... return $translation; }
- $translation(string)
- Translated text.
- $single(string)
- The text to be used if the number is singular.
- $plural(string)
- The text to be used if the number is plural.
- $number(int)
- The number to compare against to use either the singular or plural form.
- $context(string)
- Context information for the translators.
- $domain(string)
- Text domain. Unique identifier for retrieving translated strings.
Changelog
Since 2.8.0 | Introduced. |
Where the hook is called
ngettext_with_context
wp-includes/l10n.php 557
$translation = apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain );