_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
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 17:32:57

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: