返回介绍

_n_noop()

发布于 2017-09-11 10:42:18 字数 2893 浏览 1095 评论 0 收藏 0

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

Registers plural strings in POT file, but does not translate them.


description

Used when you want to keep structures with translatable plural strings and use them later when the number is known.

Example:

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

参数

$singular

(string) (Required) Singular form to be localized.

$plural

(string) (Required) Plural form to be localized.

$domain

(string) (Optional) Text domain. Unique identifier for retrieving translated strings.

Default value: 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 $domain Text domain. }


源代码

File: wp-includes/l10n.php

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

更新日志

Versiondescription
2.5.0Introduced.

相关函数

Used By

  • wp-includes/widgets/class-wp-widget-media-audio.php: WP_Widget_Media_Audio::__construct()
  • wp-includes/widgets/class-wp-widget-media-video.php: WP_Widget_Media_Video::__construct()
  • wp-includes/widgets/class-wp-widget-media.php: WP_Widget_Media::__construct()
  • wp-includes/widgets/class-wp-widget-media-image.php: WP_Widget_Media_Image::__construct()
  • wp-includes/category-template.php: wp_generate_tag_cloud()
  • wp-includes/post.php: get_post_mime_types()
  • wp-includes/post.php: register_post_status()
  • wp-includes/post.php: create_initial_post_types()
  • Show 3 more used by Hide more used by

User Contributed Notes

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文