if ( typeof pf !== 'function' ) {
plural = getPluralExpression(
config[ 'Plural-Forms' ] ||
config[ 'plural-forms' ] ||
// Ignore reason: As known, there's no way to document the empty
// string property on a key to guarantee this as metadata.
pf = pluralForms( plural );
getPluralForm = this.pluralForms[ domain ] = pf;
return getPluralForm( n );
* @param {string} domain Translation domain.
* @param {string|void} context Context distinguishing terms of the same name.
* @param {string} singular Primary key for translation lookup.
* @param {string=} plural Fallback value used for non-zero plural
* @param {number=} n Value to use in calculating plural form.
* @return {string} Translated string.
Tannin.prototype.dcnpgettext = function( domain, context, singular, plural, n ) {
// Find index by evaluating plural form for value.
index = this.getPluralForm( domain, n );
// If provided, context is prepended to key with delimiter.
key = context + this.options.contextDelimiter + singular;
entry = this.data[ domain ][ key ];
// Verify not only that entry exists, but that the intended index is within
if ( entry && entry[ index ] ) {
if ( this.options.onMissingKey ) {
this.options.onMissingKey( singular, domain );
// If entry not found, fall back to singular vs. plural with zero index
// representing the singular value.
return index === 0 ? singular : plural;
// CONCATENATED MODULE: ./node_modules/@wordpress/i18n/build-module/create-i18n.js
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
* @typedef {Record<string,any>} LocaleData
* Default locale data to use for Tannin domain when not otherwise provided.
* Assumes an English plural forms expression.
var DEFAULT_LOCALE_DATA = {
plural_forms: function plural_forms(n) {
/* eslint-disable jsdoc/valid-types */
* @typedef {(data?: LocaleData, domain?: string) => void} SetLocaleData
* Merges locale data into the Tannin instance by domain. Accepts data in a
* Jed-formatted JSON object shape.
* @see http://messageformat.github.io/Jed/
* @typedef {(domain?: string) => string} GetFilterDomain
* Retrieve the domain to use when calling domain-specific filters.
* @typedef {(text: string, domain?: string) => string} __
* Retrieve the translation of text.
* @see https://developer.wordpress.org/reference/functions/__/
* @typedef {(text: string, context: string, domain?: string) => string} _x
* Retrieve translated string with gettext context.
* @see https://developer.wordpress.org/reference/functions/_x/
* @typedef {(single: string, plural: string, number: number, domain?: string) => string} _n
* Translates and retrieves the singular or plural form based on the supplied
* @see https://developer.wordpress.org/reference/functions/_n/
* @typedef {(single: string, plural: string, number: number, context: string, domain?: string) => string} _nx
* Translates and retrieves the singular or plural form based on the supplied
* number, with gettext context.
* @see https://developer.wordpress.org/reference/functions/_nx/
* @typedef {() => boolean} IsRtl
* Check if current locale is RTL.
* **RTL (Right To Left)** is a locale property indicating that text is written from right to left.
* For example, the `he` locale (for Hebrew) specifies right-to-left. Arabic (ar) is another common
* language written RTL. The opposite of RTL, LTR (Left To Right) is used in other languages,
* including English (`en`, `en-US`, `en-GB`, etc.), Spanish (`es`), and French (`fr`).
* @typedef {{ applyFilters: (hookName:string, ...args: unknown[]) => unknown}} ApplyFiltersInterface
/* eslint-enable jsdoc/valid-types */
* @property {SetLocaleData} setLocaleData Merges locale data into the Tannin instance by domain. Accepts data in a
* Jed-formatted JSON object shape.
* @property {__} __ Retrieve the translation of text.
* @property {_x} _x Retrieve translated string with gettext context.
* @property {_n} _n Translates and retrieves the singular or plural form based on the supplied
* @property {_nx} _nx Translates and retrieves the singular or plural form based on the supplied
* number, with gettext context.
* @property {IsRtl} isRTL Check if current locale is RTL.
* Create an i18n instance
* @param {LocaleData} [initialData] Locale data configuration.
* @param {string} [initialDomain] Domain for which configuration applies.
* @param {ApplyFiltersInterface} [hooks] Hooks implementation.
* @return {I18n} I18n instance
var create_i18n_createI18n = function createI18n(initialData, initialDomain, hooks) {
* The underlying instance of Tannin to which exported functions interface.
var tannin = new Tannin({});
/** @type {SetLocaleData} */
var setLocaleData = function setLocaleData(data) {
var domain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
tannin.data[domain] = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_LOCALE_DATA), tannin.data[domain]), data); // Populate default domain configuration (supported locale date which omits
// a plural forms expression).
tannin.data[domain][''] = _objectSpread(_objectSpread({}, DEFAULT_LOCALE_DATA['']), tannin.data[domain]['']);
* Wrapper for Tannin's `dcnpgettext`. Populates default locale data if not
* otherwise previously assigned.
* @param {string|undefined} domain Domain to retrieve the translated text.
* @param {string|undefined} context Context information for the translators.
* @param {string} single Text to translate if non-plural. Used as
* fallback return value on a caught error.
* @param {string} [plural] The text to be used if the number is
* @param {number} [number] The number to compare against to use
* either the singular or plural form.
* @return {string} The translated string.
var dcnpgettext = function dcnpgettext() {
var domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
var context = arguments.length > 1 ? arguments[1] : undefined;
var single = arguments.length > 2 ? arguments[2] : undefined;
var plural = arguments.length > 3 ? arguments[3] : undefined;
var number = arguments.length > 4 ? arguments[4] : undefined;
if (!tannin.data[domain]) {
setLocaleData(undefined, domain);
return tannin.dcnpgettext(domain, context, single, plural, number);
/** @type {GetFilterDomain} */
var getFilterDomain = function getFilterDomain(domain) {
if (typeof domain === 'undefined') {
var __ = function __(text, domain) {
var translation = dcnpgettext(domain, undefined, text);
* Filters text with its translation.
* @param {string} translation Translated text.
* @param {string} text Text to translate.
* @param {string} domain Text domain. Unique identifier for retrieving translated strings.
if (typeof hooks === 'undefined') {
hooks.applyFilters('i18n.gettext', translation, text, domain);
hooks.applyFilters('i18n.gettext_' + getFilterDomain(domain), translation, text, domain)
var _x = function _x(text, context, domain) {
var translation = dcnpgettext(domain, context, text);
* Filters text with its translation based on context information.
* @param {string} translation Translated text.
* @param {string} text Text to translate.
* @param {string} context Context information for the translators.
* @param {string} domain Text domain. Unique identifier for retrieving translated strings.
if (typeof hooks === 'undefined') {
hooks.applyFilters('i18n.gettext_with_context', translation, text, context, domain);
hooks.applyFilters('i18n.gettext_with_context_' + getFilterDomain(domain), translation, text, context, domain)
var _n = function _n(single, plural, number, domain) {
var translation = dcnpgettext(domain, undefined, single, plural, number);
if (typeof hooks === 'undefined') {
* Filters the singular or plural form of a string.
* @param {string} translation Translated text.
* @param {string} single The text to be used if the number is singular.
* @param {string} plural The text to be used if the number is plural.
* @param {string} number The number to compare against to use either the singular or plural form.
* @param {string} domain Text domain. Unique identifier for retrieving translated strings.
hooks.applyFilters('i18n.ngettext', translation, single, plural, number, domain);
hooks.applyFilters('i18n.ngettext_' + getFilterDomain(domain), translation, single, plural, number, domain)
var _nx = function _nx(single, plural, number, context, domain) {
var translation = dcnpgettext(domain, context, single, plural, number);
if (typeof hooks === 'undefined') {
* Filters the singular or plural form of a string with gettext context.
* @param {string} translation Translated text.
* @param {string} single The text to be used if the number is singular.
* @param {string} plural The text to be used if the number is plural.
* @param {string} number The number to compare against to use either the singular or plural form.
* @param {string} context Context information for the translators.
* @param {string} domain Text domain. Unique identifier for retrieving translated strings.
hooks.applyFilters('i18n.ngettext_with_context', translation, single, plural, number, context, domain);
hooks.applyFilters('i18n.ngettext_with_context_' + getFilterDomain(domain), translation, single, plural, number, context, domain)
var isRTL = function isRTL() {
return 'rtl' === _x('ltr', 'text direction');
setLocaleData(initialData, initialDomain);
setLocaleData: setLocaleData,
// EXTERNAL MODULE: external ["wp","hooks"]
var external_wp_hooks_ = __webpack_require__("g56x");
// CONCATENATED MODULE: ./node_modules/@wordpress/i18n/build-module/default-i18n.js
var i18n = create_i18n_createI18n(undefined, undefined, {
applyFilters: external_wp_hooks_["applyFilters"]
* Comments in this file are duplicated from ./i18n due to
* https://github.com/WordPress/gutenberg/pull/20318#issuecomment-590837722
* @typedef {import('./create-i18n').LocaleData} LocaleData
* Merges locale data into the Tannin instance by domain. Accepts data in a
* Jed-formatted JSON object shape.
* @see http://messageformat.github.io/Jed/
* @param {LocaleData} [data] Locale data configuration.
* @param {string} [domain] Domain for which configuration applies.
var default_i18n_setLocaleData = i18n.setLocaleData.bind(i18n);
* Retrieve the translation of text.
* @see https://developer.wordpress.org/reference/functions/__/
* @param {string} text Text to translate.
* @param {string} [domain] Domain to retrieve the translated text.
* @return {string} Translated text.
var default_i18n_ = i18n.__.bind(i18n);
* Retrieve translated string with gettext context.
* @see https://developer.wordpress.org/reference/functions/_x/
* @param {string} text Text to translate.
* @param {string} context Context information for the translators.
* @param {string} [domain] Domain to retrieve the translated text.
* @return {string} Translated context string without pipe.
var default_i18n_x = i18n._x.bind(i18n);
* Translates and retrieves the singular or plural form based on the supplied
* @see https://developer.wordpress.org/reference/functions/_n/
* @param {string} single The text to be used if the number is singular.
* @param {string} plural The text to be used if the number is plural.
* @param {number} number The number to compare against to use either the
* singular or plural form.
* @param {string} [domain] Domain to retrieve the translated text.
* @return {string} The translated singular or plural form.
var default_i18n_n = i18n._n.bind(i18n);
* Translates and retrieves the singular or plural form based on the supplied
* number, with gettext context.
* @see https://developer.wordpress.org/reference/functions/_nx/
* @param {string} single The text to be used if the number is singular.
* @param {string} plural The text to be used if the number is plural.
* @param {number} number The number to compare against to use either the
* singular or plural form.
* @param {string} context Context information for the translators.
* @param {string} [domain] Domain to retrieve the translated text.
* @return {string} The translated singular or plural form.
var default_i18n_nx = i18n._nx.bind(i18n);
* Check if current locale is RTL.
* **RTL (Right To Left)** is a locale property indicating that text is written from right to left.
* For example, the `he` locale (for Hebrew) specifies right-to-left. Arabic (ar) is another common
* language written RTL. The opposite of RTL, LTR (Left To Right) is used in other languages,
* including English (`en`, `en-US`, `en-GB`, etc.), Spanish (`es`), and French (`fr`).
* @return {boolean} Whether locale is RTL.
var default_i18n_isRTL = i18n.isRTL.bind(i18n);
// CONCATENATED MODULE: ./node_modules/@wordpress/i18n/build-module/index.js