_nc ( $single, $plural, $number, $domain = 'default' )
引數
  • (string) $single The text to be used if the number is singular.
    Required:
  • (string) $plural The text to be used if the number is plural.
    Required:
  • (int) $number The number to compare against to use either the singular or plural form.
    Required:
  • (string) $domain Optional. Text domain. Unique identifier for retrieving translated strings. Default 'default'.
    Required:
    Default: 'default'
返回值
  • (string) The translated singular or plural form.
相關
  • _nx()
定義位置
相關方法
_n_c_nx_
引入
2.7.0
棄用
2.9.0

_nc: 這個函式用來翻譯一個帶有上下文的字串。

_n()的遺留版本,它支援上下文。

從翻譯中刪除最後一個小節後的所有內容。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function _nc( $single, $plural, $number, $domain = 'default' ) {
_deprecated_function( __FUNCTION__, '2.9.0', '_nx()' );
return before_last_bar( _n( $single, $plural, $number, $domain ) );
}
function _nc( $single, $plural, $number, $domain = 'default' ) { _deprecated_function( __FUNCTION__, '2.9.0', '_nx()' ); return before_last_bar( _n( $single, $plural, $number, $domain ) ); }
function _nc( $single, $plural, $number, $domain = 'default' ) {
	_deprecated_function( __FUNCTION__, '2.9.0', '_nx()' );
	return before_last_bar( _n( $single, $plural, $number, $domain ) );
}

常見問題

FAQs
檢視更多 >