+/**
+ * Translate string with gettext context, and escapes it for safe use in HTML output.
+ *
+ * @since 2.9.0
+ *
+ * @param string $text Text to translate.
+ * @param string $context Context information for the translators.
+ * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.
+ * @return string Translated text.
+ */
+function esc_html_x( $text, $context, $domain = 'default' ) {
+ return esc_html( translate_with_gettext_context( $text, $context, $domain ) );
+}
+
+/**
+ * Retrieve the plural or single form based on the supplied amount.
+ *
+ * If the text domain is not set in the $l10n list, then a comparison will be made
+ * and either $plural or $single parameters returned.
+ *
+ * If the text domain does exist, then the parameters $single, $plural, and $number
+ * will first be passed to the text domain's ngettext method. Then it will be passed
+ * to the 'ngettext' filter hook along with the same parameters. The expected
+ * type will be a string.
+ *
+ * @since 2.8.0
+ *
+ * @param string $single The text that will be used if $number is 1.
+ * @param string $plural The text that will be used if $number is not 1.
+ * @param int $number The number to compare against to use either $single or $plural.
+ * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.
+ * @return string Either $single or $plural translated text.
+ */
+function _n( $single, $plural, $number, $domain = 'default' ) {
+ $translations = get_translations_for_domain( $domain );
+ $translation = $translations->translate_plural( $single, $plural, $number );
+ /**
+ * Filter text with its translation when plural option is available.
+ *
+ * @since 2.2.0
+ *
+ * @param string $translation Translated text.
+ * @param string $single The text that will be used if $number is 1.
+ * @param string $plural The text that will be used if $number is not 1.
+ * @param string $number The number to compare against to use either $single or $plural.
+ * @param string $domain Text domain. Unique identifier for retrieving translated strings.
+ */
+ return apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain );
+}
+
+/**
+ * Retrieve the plural or single form based on the supplied amount with gettext context.
+ *
+ * This is a hybrid of _n() and _x(). It supports contexts and plurals.
+ *
+ * @since 2.8.0
+ *
+ * @param string $single The text that will be used if $number is 1.
+ * @param string $plural The text that will be used if $number is not 1.
+ * @param int $number The number to compare against to use either $single or $plural.
+ * @param string $context Context information for the translators.
+ * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.
+ * @return string Either $single or $plural translated text with context.
+ */
+function _nx($single, $plural, $number, $context, $domain = 'default') {
+ $translations = get_translations_for_domain( $domain );
+ $translation = $translations->translate_plural( $single, $plural, $number, $context );
+ /**
+ * Filter text with its translation while plural option and context are available.
+ *
+ * @since 2.8.0
+ *
+ * @param string $translation Translated text.
+ * @param string $single The text that will be used if $number is 1.
+ * @param string $plural The text that will be used if $number is not 1.
+ * @param string $number The number to compare against to use either $single or $plural.
+ * @param string $context Context information for the translators.
+ * @param string $domain Text domain. Unique identifier for retrieving translated strings.
+ */
+ return apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain );