翻译并检索已使用_n_noop()或_nx_noop()注册的字符串的单数或复数形式。
原型
translate_nooped_plural( array $nooped_plural, int $count, string $domain = 'default' )
描述
在数字已知时,如果要使用可翻译的复数字符串,请使用此选项。
参数
$nooped_plural
(array)
(Required)
具有单数,复数和上下文键的数组,通常是_n_noop()或_nx_noop()的结果。
$count
(int)
(Required)
对象数量。
$domain
(string)
(Optional)
文字域名。用于检索已翻译字符串的唯一标识符如果$ nooped_plural包含传递给_n_noop()或_nx_noop()的文本域,它将覆盖此值。
返回值
(string)
$ single或$ plural翻译文本。
源文件
路径:wp-includes/l10n.php
<?php
...
function translate_nooped_plural( $nooped_plural, $count, $domain = 'default' ) {
if ( $nooped_plural['domain'] )
$domain = $nooped_plural['domain'];
if ( $nooped_plural['context'] )
return _nx( $nooped_plural['singular'], $nooped_plural['plural'], $count, $nooped_plural['context'], $domain );
else
return _n( $nooped_plural['singular'], $nooped_plural['plural'], $count, $domain );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/translate_nooped_plural/