WordPress函数:_n_loop 在 pot 文件中注册字符串

江河/ 04月17日/ WordPress/ 浏览 123

函数原型:


_n_noop( string $singular, string $plural, string $domain = null ): array


在POT文件中注册多个字符串,但不翻译它们。


当您希望保留具有可翻译复数字符串的结构,并在以后知道数字时使用它们时使用。


举例:


$message = _n_noop( '%s post', '%s posts', 'text-domain' );
...
printf( translate_nooped_plural( $message, $count, 'text-domain' ), number_format_i18n( $count ) );


参数说明:


$singular 要局部化的奇异形式。


$plural 复数形式要本地化。


$domain 文本域。用于检索翻译字符串的唯一标识符。


返回值:


string 要局部化的奇异形式。不再使用。


1 string 复数形式要本地化。不再使用。


singular string 要局部化的奇异形式。


plural string 复数形式要本地化。


context null 为翻译人员提供上下文信息。


domain string|null 文本域。


函数源码:


function _n_noop( $singular, $plural, $domain = null ) {
	return array(
		0          => $singular,
		1          => $plural,
		'singular' => $singular,
		'plural'   => $plural,
		'context'  => null,
		'domain'   => $domain,
	);
}


发表评论

暂无评论,抢个沙发...

客服 工单