Translates a plural string.
Parameters
$singular
string|nullrequired- Singular string.
$plural
string|nullrequired- Plural string.
$count
int|floatoptional- Count. Should be an integer, but some plugins pass floats.
Default:
1
$context
string|nulloptional- Context.
Default:
''
Source
public function translate_plural( $singular, $plural, $count = 1, $context = '' ) {
if ( null === $singular || null === $plural ) {
return $singular;
}
$translation = $this->controller->translate_plural( array( $singular, $plural ), (int) $count, (string) $context, $this->textdomain );
if ( false !== $translation ) {
return $translation;
}
// Fall back to the original with English grammar rules.
return ( 1 === $count ? $singular : $plural );
}
Changelog
Version | Description |
---|---|
6.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.