_n_noop

函数
_n_noop ( $singular, $plural, $domain = null )
参数
  • (string) $singular Singular form to be localized.
    Required:
  • (string) $plural Plural form to be localized.
    Required:
  • (string) $domain Optional. Text domain. Unique identifier for retrieving translated strings. Default null.
    Required:
    Default: null
返回值
  • (array) { Array of translation information for the strings. @type string $0 Singular form to be localized. No longer used. @type string $1 Plural form to be localized. No longer used. @type string $singular Singular form to be localized. @type string $plural Plural form to be localized. @type null $context Context information for the translators. @type string|null $domain Text domain. }
定义位置
相关方法
_nx_noop__ngettext_noopin_the_loop
引入
2.5.0
弃用
-

_n_noop: 这个函数用来翻译一个单数或复数的字符串,而不对其进行回声。

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

当你想保留带有可翻译的复数字符串的结构并在以后知道数字时使用它们时使用。

例子:

$message = _n_noop( ‘%s post’, ‘%s posts’, ‘text-domain’ );

printf( translate_nooped_plural( $message, $count, ‘text-domain’ ), number_format_i18n( $count ) );

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

常见问题

FAQs
查看更多 >