ngettext_with_context

过滤钩子
apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain )
参数
  • (string) $translation Translated text.
    Required:
  • (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) $context Context information for the translators.
    Required:
  • (string) $domain Text domain. Unique identifier for retrieving translated strings.
    Required:
定义位置
相关勾子
gettext_with_contextngettext_with_context_domaingettext_with_context_domainwidget_text_contentdelete_site_email_content
相关方法
translate_with_contextget_the_contentget_the_content_feedtranslate_with_gettext_contextget_url_in_contentunregister_widget_control
引入
2.8.0
弃用
-

ngettext_with_context是ngettext的一个变体,它需要一个额外的参数$context,以帮助区分一个字符串的正确翻译,以防它在不同的语境中被用于不同的含义。

使用gettext上下文过滤字符串的单数或复数形式。

$translation = apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain );

常见问题

FAQs
查看更多 >