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上下文過濾字串的單數或複數形式。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$translation = apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain );
$translation = apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain );
$translation = apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain );

常見問題

FAQs
檢視更多 >