_nx()获取对单复数进行翻译后的字符串

目录

描述

A hybrid of _n() and _x(). It supports contexts and plurals.

_nx() 描述

用法

<?php _nx$single$plural$number$context$domain ?>

_nx() 用法

参数

$single

(string) (必填) The text that will be used if $number is 1

默认值: None

$plural

(string) (必填) The text that will be used if $number is not 1

默认值: None

$number

(int) (必填) The number to compare against to use either $single or $plural

默认值: None

$context

(string) (必填) Context information for the translators

默认值: None

$domain

(string) (可选) Domain to retrieve the translated text

默认值: 'default'

_nx() 参数

返回值

(string) 

Either $single or $plural translated context string.

_nx() 返回值

注意

  • 使用到 the 'ngettext_with_context' 过滤器.
  • l10n is an abbreviation for localization.

_nx() 注意

历史

  • 添加于 版本: 3.0.0

_nx() 历史

源文件

_nx() 函数的代码位于 wp-includes/l10n.php.

_nx() 源文件

相关