@wordpress/i18n 4.50.0 → 4.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/create-i18n.js +4 -4
- package/build/default-i18n.js +11 -22
- package/build/default-i18n.js.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build-module/create-i18n.js +4 -4
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/build/create-i18n.js
CHANGED
|
@@ -284,7 +284,7 @@ const createI18n = (initialData, initialDomain, hooks) => {
|
|
|
284
284
|
*/
|
|
285
285
|
translation = /** @type {string} */
|
|
286
286
|
/** @type {*} */hooks.applyFilters('i18n.gettext', translation, text, domain);
|
|
287
|
-
return
|
|
287
|
+
return /** @type {string} */(
|
|
288
288
|
/** @type {*} */hooks.applyFilters('i18n.gettext_' + getFilterDomain(domain), translation, text, domain)
|
|
289
289
|
);
|
|
290
290
|
};
|
|
@@ -306,7 +306,7 @@ const createI18n = (initialData, initialDomain, hooks) => {
|
|
|
306
306
|
*/
|
|
307
307
|
translation = /** @type {string} */
|
|
308
308
|
/** @type {*} */hooks.applyFilters('i18n.gettext_with_context', translation, text, context, domain);
|
|
309
|
-
return
|
|
309
|
+
return /** @type {string} */(
|
|
310
310
|
/** @type {*} */hooks.applyFilters('i18n.gettext_with_context_' + getFilterDomain(domain), translation, text, context, domain)
|
|
311
311
|
);
|
|
312
312
|
};
|
|
@@ -329,7 +329,7 @@ const createI18n = (initialData, initialDomain, hooks) => {
|
|
|
329
329
|
*/
|
|
330
330
|
translation = /** @type {string} */
|
|
331
331
|
/** @type {*} */hooks.applyFilters('i18n.ngettext', translation, single, plural, number, domain);
|
|
332
|
-
return
|
|
332
|
+
return /** @type {string} */(
|
|
333
333
|
/** @type {*} */hooks.applyFilters('i18n.ngettext_' + getFilterDomain(domain), translation, single, plural, number, domain)
|
|
334
334
|
);
|
|
335
335
|
};
|
|
@@ -353,7 +353,7 @@ const createI18n = (initialData, initialDomain, hooks) => {
|
|
|
353
353
|
*/
|
|
354
354
|
translation = /** @type {string} */
|
|
355
355
|
/** @type {*} */hooks.applyFilters('i18n.ngettext_with_context', translation, single, plural, number, context, domain);
|
|
356
|
-
return
|
|
356
|
+
return /** @type {string} */(
|
|
357
357
|
/** @type {*} */hooks.applyFilters('i18n.ngettext_with_context_' + getFilterDomain(domain), translation, single, plural, number, context, domain)
|
|
358
358
|
);
|
|
359
359
|
};
|
package/build/default-i18n.js
CHANGED
|
@@ -19,7 +19,7 @@ const i18n = (0, _createI18n.createI18n)(undefined, undefined, _hooks.defaultHoo
|
|
|
19
19
|
/**
|
|
20
20
|
* Default, singleton instance of `I18n`.
|
|
21
21
|
*/
|
|
22
|
-
var _default = i18n;
|
|
22
|
+
var _default = exports.default = i18n;
|
|
23
23
|
/*
|
|
24
24
|
* Comments in this file are duplicated from ./i18n due to
|
|
25
25
|
* https://github.com/WordPress/gutenberg/pull/20318#issuecomment-590837722
|
|
@@ -37,8 +37,7 @@ var _default = i18n;
|
|
|
37
37
|
* @param {string} [domain] Domain for which to get the data.
|
|
38
38
|
* @return {LocaleData} Locale data.
|
|
39
39
|
*/
|
|
40
|
-
exports.
|
|
41
|
-
const getLocaleData = i18n.getLocaleData.bind(i18n);
|
|
40
|
+
const getLocaleData = exports.getLocaleData = i18n.getLocaleData.bind(i18n);
|
|
42
41
|
|
|
43
42
|
/**
|
|
44
43
|
* Merges locale data into the Tannin instance by domain. Accepts data in a
|
|
@@ -49,8 +48,7 @@ const getLocaleData = i18n.getLocaleData.bind(i18n);
|
|
|
49
48
|
* @param {LocaleData} [data] Locale data configuration.
|
|
50
49
|
* @param {string} [domain] Domain for which configuration applies.
|
|
51
50
|
*/
|
|
52
|
-
exports.
|
|
53
|
-
const setLocaleData = i18n.setLocaleData.bind(i18n);
|
|
51
|
+
const setLocaleData = exports.setLocaleData = i18n.setLocaleData.bind(i18n);
|
|
54
52
|
|
|
55
53
|
/**
|
|
56
54
|
* Resets all current Tannin instance locale data and sets the specified
|
|
@@ -61,8 +59,7 @@ const setLocaleData = i18n.setLocaleData.bind(i18n);
|
|
|
61
59
|
* @param {LocaleData} [data] Locale data configuration.
|
|
62
60
|
* @param {string} [domain] Domain for which configuration applies.
|
|
63
61
|
*/
|
|
64
|
-
exports.
|
|
65
|
-
const resetLocaleData = i18n.resetLocaleData.bind(i18n);
|
|
62
|
+
const resetLocaleData = exports.resetLocaleData = i18n.resetLocaleData.bind(i18n);
|
|
66
63
|
|
|
67
64
|
/**
|
|
68
65
|
* Subscribes to changes of locale data
|
|
@@ -70,8 +67,7 @@ const resetLocaleData = i18n.resetLocaleData.bind(i18n);
|
|
|
70
67
|
* @param {SubscribeCallback} callback Subscription callback
|
|
71
68
|
* @return {UnsubscribeCallback} Unsubscribe callback
|
|
72
69
|
*/
|
|
73
|
-
exports.
|
|
74
|
-
const subscribe = i18n.subscribe.bind(i18n);
|
|
70
|
+
const subscribe = exports.subscribe = i18n.subscribe.bind(i18n);
|
|
75
71
|
|
|
76
72
|
/**
|
|
77
73
|
* Retrieve the translation of text.
|
|
@@ -83,8 +79,7 @@ const subscribe = i18n.subscribe.bind(i18n);
|
|
|
83
79
|
*
|
|
84
80
|
* @return {string} Translated text.
|
|
85
81
|
*/
|
|
86
|
-
exports.
|
|
87
|
-
const __ = i18n.__.bind(i18n);
|
|
82
|
+
const __ = exports.__ = i18n.__.bind(i18n);
|
|
88
83
|
|
|
89
84
|
/**
|
|
90
85
|
* Retrieve translated string with gettext context.
|
|
@@ -97,8 +92,7 @@ const __ = i18n.__.bind(i18n);
|
|
|
97
92
|
*
|
|
98
93
|
* @return {string} Translated context string without pipe.
|
|
99
94
|
*/
|
|
100
|
-
exports.
|
|
101
|
-
const _x = i18n._x.bind(i18n);
|
|
95
|
+
const _x = exports._x = i18n._x.bind(i18n);
|
|
102
96
|
|
|
103
97
|
/**
|
|
104
98
|
* Translates and retrieves the singular or plural form based on the supplied
|
|
@@ -114,8 +108,7 @@ const _x = i18n._x.bind(i18n);
|
|
|
114
108
|
*
|
|
115
109
|
* @return {string} The translated singular or plural form.
|
|
116
110
|
*/
|
|
117
|
-
exports.
|
|
118
|
-
const _n = i18n._n.bind(i18n);
|
|
111
|
+
const _n = exports._n = i18n._n.bind(i18n);
|
|
119
112
|
|
|
120
113
|
/**
|
|
121
114
|
* Translates and retrieves the singular or plural form based on the supplied
|
|
@@ -132,8 +125,7 @@ const _n = i18n._n.bind(i18n);
|
|
|
132
125
|
*
|
|
133
126
|
* @return {string} The translated singular or plural form.
|
|
134
127
|
*/
|
|
135
|
-
exports.
|
|
136
|
-
const _nx = i18n._nx.bind(i18n);
|
|
128
|
+
const _nx = exports._nx = i18n._nx.bind(i18n);
|
|
137
129
|
|
|
138
130
|
/**
|
|
139
131
|
* Check if current locale is RTL.
|
|
@@ -145,8 +137,7 @@ const _nx = i18n._nx.bind(i18n);
|
|
|
145
137
|
*
|
|
146
138
|
* @return {boolean} Whether locale is RTL.
|
|
147
139
|
*/
|
|
148
|
-
exports.
|
|
149
|
-
const isRTL = i18n.isRTL.bind(i18n);
|
|
140
|
+
const isRTL = exports.isRTL = i18n.isRTL.bind(i18n);
|
|
150
141
|
|
|
151
142
|
/**
|
|
152
143
|
* Check if there is a translation for a given string (in singular form).
|
|
@@ -156,7 +147,5 @@ const isRTL = i18n.isRTL.bind(i18n);
|
|
|
156
147
|
* @param {string} [domain] Domain to retrieve the translated text.
|
|
157
148
|
* @return {boolean} Whether the translation exists or not.
|
|
158
149
|
*/
|
|
159
|
-
exports.
|
|
160
|
-
const hasTranslation = i18n.hasTranslation.bind(i18n);
|
|
161
|
-
exports.hasTranslation = hasTranslation;
|
|
150
|
+
const hasTranslation = exports.hasTranslation = i18n.hasTranslation.bind(i18n);
|
|
162
151
|
//# sourceMappingURL=default-i18n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_createI18n","require","_hooks","i18n","createI18n","undefined","defaultHooks","_default","exports","default","getLocaleData","bind","setLocaleData","resetLocaleData","subscribe","__","_x","_n","_nx","isRTL","hasTranslation"],"sources":["@wordpress/i18n/src/default-i18n.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { createI18n } from './create-i18n';\n\n/**\n * WordPress dependencies\n */\nimport { defaultHooks } from '@wordpress/hooks';\n\nconst i18n = createI18n( undefined, undefined, defaultHooks );\n\n/**\n * Default, singleton instance of `I18n`.\n */\nexport default i18n;\n\n/*\n * Comments in this file are duplicated from ./i18n due to\n * https://github.com/WordPress/gutenberg/pull/20318#issuecomment-590837722\n */\n\n/**\n * @typedef {import('./create-i18n').LocaleData} LocaleData\n * @typedef {import('./create-i18n').SubscribeCallback} SubscribeCallback\n * @typedef {import('./create-i18n').UnsubscribeCallback} UnsubscribeCallback\n */\n\n/**\n * Returns locale data by domain in a Jed-formatted JSON object shape.\n *\n * @see http://messageformat.github.io/Jed/\n *\n * @param {string} [domain] Domain for which to get the data.\n * @return {LocaleData} Locale data.\n */\nexport const getLocaleData = i18n.getLocaleData.bind( i18n );\n\n/**\n * Merges locale data into the Tannin instance by domain. Accepts data in a\n * Jed-formatted JSON object shape.\n *\n * @see http://messageformat.github.io/Jed/\n *\n * @param {LocaleData} [data] Locale data configuration.\n * @param {string} [domain] Domain for which configuration applies.\n */\nexport const setLocaleData = i18n.setLocaleData.bind( i18n );\n\n/**\n * Resets all current Tannin instance locale data and sets the specified\n * locale data for the domain. Accepts data in a Jed-formatted JSON object shape.\n *\n * @see http://messageformat.github.io/Jed/\n *\n * @param {LocaleData} [data] Locale data configuration.\n * @param {string} [domain] Domain for which configuration applies.\n */\nexport const resetLocaleData = i18n.resetLocaleData.bind( i18n );\n\n/**\n * Subscribes to changes of locale data\n *\n * @param {SubscribeCallback} callback Subscription callback\n * @return {UnsubscribeCallback} Unsubscribe callback\n */\nexport const subscribe = i18n.subscribe.bind( i18n );\n\n/**\n * Retrieve the translation of text.\n *\n * @see https://developer.wordpress.org/reference/functions/__/\n *\n * @param {string} text Text to translate.\n * @param {string} [domain] Domain to retrieve the translated text.\n *\n * @return {string} Translated text.\n */\nexport const __ = i18n.__.bind( i18n );\n\n/**\n * Retrieve translated string with gettext context.\n *\n * @see https://developer.wordpress.org/reference/functions/_x/\n *\n * @param {string} text Text to translate.\n * @param {string} context Context information for the translators.\n * @param {string} [domain] Domain to retrieve the translated text.\n *\n * @return {string} Translated context string without pipe.\n */\nexport const _x = i18n._x.bind( i18n );\n\n/**\n * Translates and retrieves the singular or plural form based on the supplied\n * number.\n *\n * @see https://developer.wordpress.org/reference/functions/_n/\n *\n * @param {string} single The text to be used if the number is singular.\n * @param {string} plural The text to be used if the number is plural.\n * @param {number} number The number to compare against to use either the\n * singular or plural form.\n * @param {string} [domain] Domain to retrieve the translated text.\n *\n * @return {string} The translated singular or plural form.\n */\nexport const _n = i18n._n.bind( i18n );\n\n/**\n * Translates and retrieves the singular or plural form based on the supplied\n * number, with gettext context.\n *\n * @see https://developer.wordpress.org/reference/functions/_nx/\n *\n * @param {string} single The text to be used if the number is singular.\n * @param {string} plural The text to be used if the number is plural.\n * @param {number} number The number to compare against to use either the\n * singular or plural form.\n * @param {string} context Context information for the translators.\n * @param {string} [domain] Domain to retrieve the translated text.\n *\n * @return {string} The translated singular or plural form.\n */\nexport const _nx = i18n._nx.bind( i18n );\n\n/**\n * Check if current locale is RTL.\n *\n * **RTL (Right To Left)** is a locale property indicating that text is written from right to left.\n * For example, the `he` locale (for Hebrew) specifies right-to-left. Arabic (ar) is another common\n * language written RTL. The opposite of RTL, LTR (Left To Right) is used in other languages,\n * including English (`en`, `en-US`, `en-GB`, etc.), Spanish (`es`), and French (`fr`).\n *\n * @return {boolean} Whether locale is RTL.\n */\nexport const isRTL = i18n.isRTL.bind( i18n );\n\n/**\n * Check if there is a translation for a given string (in singular form).\n *\n * @param {string} single Singular form of the string to look up.\n * @param {string} [context] Context information for the translators.\n * @param {string} [domain] Domain to retrieve the translated text.\n * @return {boolean} Whether the translation exists or not.\n */\nexport const hasTranslation = i18n.hasTranslation.bind( i18n );\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAME,IAAI,GAAG,IAAAC,sBAAU,EAAEC,SAAS,EAAEA,SAAS,EAAEC,mBAAa,CAAC;;AAE7D;AACA;AACA;AAFA,IAAAC,QAAA,
|
|
1
|
+
{"version":3,"names":["_createI18n","require","_hooks","i18n","createI18n","undefined","defaultHooks","_default","exports","default","getLocaleData","bind","setLocaleData","resetLocaleData","subscribe","__","_x","_n","_nx","isRTL","hasTranslation"],"sources":["@wordpress/i18n/src/default-i18n.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { createI18n } from './create-i18n';\n\n/**\n * WordPress dependencies\n */\nimport { defaultHooks } from '@wordpress/hooks';\n\nconst i18n = createI18n( undefined, undefined, defaultHooks );\n\n/**\n * Default, singleton instance of `I18n`.\n */\nexport default i18n;\n\n/*\n * Comments in this file are duplicated from ./i18n due to\n * https://github.com/WordPress/gutenberg/pull/20318#issuecomment-590837722\n */\n\n/**\n * @typedef {import('./create-i18n').LocaleData} LocaleData\n * @typedef {import('./create-i18n').SubscribeCallback} SubscribeCallback\n * @typedef {import('./create-i18n').UnsubscribeCallback} UnsubscribeCallback\n */\n\n/**\n * Returns locale data by domain in a Jed-formatted JSON object shape.\n *\n * @see http://messageformat.github.io/Jed/\n *\n * @param {string} [domain] Domain for which to get the data.\n * @return {LocaleData} Locale data.\n */\nexport const getLocaleData = i18n.getLocaleData.bind( i18n );\n\n/**\n * Merges locale data into the Tannin instance by domain. Accepts data in a\n * Jed-formatted JSON object shape.\n *\n * @see http://messageformat.github.io/Jed/\n *\n * @param {LocaleData} [data] Locale data configuration.\n * @param {string} [domain] Domain for which configuration applies.\n */\nexport const setLocaleData = i18n.setLocaleData.bind( i18n );\n\n/**\n * Resets all current Tannin instance locale data and sets the specified\n * locale data for the domain. Accepts data in a Jed-formatted JSON object shape.\n *\n * @see http://messageformat.github.io/Jed/\n *\n * @param {LocaleData} [data] Locale data configuration.\n * @param {string} [domain] Domain for which configuration applies.\n */\nexport const resetLocaleData = i18n.resetLocaleData.bind( i18n );\n\n/**\n * Subscribes to changes of locale data\n *\n * @param {SubscribeCallback} callback Subscription callback\n * @return {UnsubscribeCallback} Unsubscribe callback\n */\nexport const subscribe = i18n.subscribe.bind( i18n );\n\n/**\n * Retrieve the translation of text.\n *\n * @see https://developer.wordpress.org/reference/functions/__/\n *\n * @param {string} text Text to translate.\n * @param {string} [domain] Domain to retrieve the translated text.\n *\n * @return {string} Translated text.\n */\nexport const __ = i18n.__.bind( i18n );\n\n/**\n * Retrieve translated string with gettext context.\n *\n * @see https://developer.wordpress.org/reference/functions/_x/\n *\n * @param {string} text Text to translate.\n * @param {string} context Context information for the translators.\n * @param {string} [domain] Domain to retrieve the translated text.\n *\n * @return {string} Translated context string without pipe.\n */\nexport const _x = i18n._x.bind( i18n );\n\n/**\n * Translates and retrieves the singular or plural form based on the supplied\n * number.\n *\n * @see https://developer.wordpress.org/reference/functions/_n/\n *\n * @param {string} single The text to be used if the number is singular.\n * @param {string} plural The text to be used if the number is plural.\n * @param {number} number The number to compare against to use either the\n * singular or plural form.\n * @param {string} [domain] Domain to retrieve the translated text.\n *\n * @return {string} The translated singular or plural form.\n */\nexport const _n = i18n._n.bind( i18n );\n\n/**\n * Translates and retrieves the singular or plural form based on the supplied\n * number, with gettext context.\n *\n * @see https://developer.wordpress.org/reference/functions/_nx/\n *\n * @param {string} single The text to be used if the number is singular.\n * @param {string} plural The text to be used if the number is plural.\n * @param {number} number The number to compare against to use either the\n * singular or plural form.\n * @param {string} context Context information for the translators.\n * @param {string} [domain] Domain to retrieve the translated text.\n *\n * @return {string} The translated singular or plural form.\n */\nexport const _nx = i18n._nx.bind( i18n );\n\n/**\n * Check if current locale is RTL.\n *\n * **RTL (Right To Left)** is a locale property indicating that text is written from right to left.\n * For example, the `he` locale (for Hebrew) specifies right-to-left. Arabic (ar) is another common\n * language written RTL. The opposite of RTL, LTR (Left To Right) is used in other languages,\n * including English (`en`, `en-US`, `en-GB`, etc.), Spanish (`es`), and French (`fr`).\n *\n * @return {boolean} Whether locale is RTL.\n */\nexport const isRTL = i18n.isRTL.bind( i18n );\n\n/**\n * Check if there is a translation for a given string (in singular form).\n *\n * @param {string} single Singular form of the string to look up.\n * @param {string} [context] Context information for the translators.\n * @param {string} [domain] Domain to retrieve the translated text.\n * @return {boolean} Whether the translation exists or not.\n */\nexport const hasTranslation = i18n.hasTranslation.bind( i18n );\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAME,IAAI,GAAG,IAAAC,sBAAU,EAAEC,SAAS,EAAEA,SAAS,EAAEC,mBAAa,CAAC;;AAE7D;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGeN,IAAI;AAEnB;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMO,aAAa,GAAAF,OAAA,CAAAE,aAAA,GAAGP,IAAI,CAACO,aAAa,CAACC,IAAI,CAAER,IAAK,CAAC;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMS,aAAa,GAAAJ,OAAA,CAAAI,aAAA,GAAGT,IAAI,CAACS,aAAa,CAACD,IAAI,CAAER,IAAK,CAAC;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMU,eAAe,GAAAL,OAAA,CAAAK,eAAA,GAAGV,IAAI,CAACU,eAAe,CAACF,IAAI,CAAER,IAAK,CAAC;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACO,MAAMW,SAAS,GAAAN,OAAA,CAAAM,SAAA,GAAGX,IAAI,CAACW,SAAS,CAACH,IAAI,CAAER,IAAK,CAAC;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMY,EAAE,GAAAP,OAAA,CAAAO,EAAA,GAAGZ,IAAI,CAACY,EAAE,CAACJ,IAAI,CAAER,IAAK,CAAC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMa,EAAE,GAAAR,OAAA,CAAAQ,EAAA,GAAGb,IAAI,CAACa,EAAE,CAACL,IAAI,CAAER,IAAK,CAAC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMc,EAAE,GAAAT,OAAA,CAAAS,EAAA,GAAGd,IAAI,CAACc,EAAE,CAACN,IAAI,CAAER,IAAK,CAAC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMe,GAAG,GAAAV,OAAA,CAAAU,GAAA,GAAGf,IAAI,CAACe,GAAG,CAACP,IAAI,CAAER,IAAK,CAAC;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMgB,KAAK,GAAAX,OAAA,CAAAW,KAAA,GAAGhB,IAAI,CAACgB,KAAK,CAACR,IAAI,CAAER,IAAK,CAAC;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMiB,cAAc,GAAAZ,OAAA,CAAAY,cAAA,GAAGjB,IAAI,CAACiB,cAAc,CAACT,IAAI,CAAER,IAAK,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -103,6 +103,6 @@ Object.keys(_createI18n).forEach(function (key) {
|
|
|
103
103
|
});
|
|
104
104
|
});
|
|
105
105
|
var _defaultI18n = _interopRequireWildcard(require("./default-i18n"));
|
|
106
|
-
function _getRequireWildcardCache(
|
|
107
|
-
function _interopRequireWildcard(
|
|
106
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
107
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
108
108
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_sprintf","require","_createI18n","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_defaultI18n","_interopRequireWildcard","_getRequireWildcardCache","
|
|
1
|
+
{"version":3,"names":["_sprintf","require","_createI18n","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_defaultI18n","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set"],"sources":["@wordpress/i18n/src/index.js"],"sourcesContent":["export { sprintf } from './sprintf';\nexport * from './create-i18n';\nexport {\n\tdefault as defaultI18n,\n\tsetLocaleData,\n\tresetLocaleData,\n\tgetLocaleData,\n\tsubscribe,\n\t__,\n\t_x,\n\t_n,\n\t_nx,\n\tisRTL,\n\thasTranslation,\n} from './default-i18n';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,WAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,WAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,WAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,YAAA,GAAAC,uBAAA,CAAAf,OAAA;AAYwB,SAAAgB,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAP,GAAA,CAAAI,CAAA,OAAAO,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAxB,MAAA,CAAAS,cAAA,IAAAT,MAAA,CAAAyB,wBAAA,WAAAC,CAAA,IAAAX,CAAA,oBAAAW,CAAA,IAAA1B,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAS,CAAA,EAAAW,CAAA,SAAAC,CAAA,GAAAH,CAAA,GAAAxB,MAAA,CAAAyB,wBAAA,CAAAV,CAAA,EAAAW,CAAA,UAAAC,CAAA,KAAAA,CAAA,CAAAhB,GAAA,IAAAgB,CAAA,CAAAC,GAAA,IAAA5B,MAAA,CAAAS,cAAA,CAAAa,CAAA,EAAAI,CAAA,EAAAC,CAAA,IAAAL,CAAA,CAAAI,CAAA,IAAAX,CAAA,CAAAW,CAAA,YAAAJ,CAAA,CAAAF,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAU,GAAA,CAAAb,CAAA,EAAAO,CAAA,GAAAA,CAAA"}
|
|
@@ -277,7 +277,7 @@ export const createI18n = (initialData, initialDomain, hooks) => {
|
|
|
277
277
|
*/
|
|
278
278
|
translation = /** @type {string} */
|
|
279
279
|
/** @type {*} */hooks.applyFilters('i18n.gettext', translation, text, domain);
|
|
280
|
-
return
|
|
280
|
+
return /** @type {string} */(
|
|
281
281
|
/** @type {*} */hooks.applyFilters('i18n.gettext_' + getFilterDomain(domain), translation, text, domain)
|
|
282
282
|
);
|
|
283
283
|
};
|
|
@@ -299,7 +299,7 @@ export const createI18n = (initialData, initialDomain, hooks) => {
|
|
|
299
299
|
*/
|
|
300
300
|
translation = /** @type {string} */
|
|
301
301
|
/** @type {*} */hooks.applyFilters('i18n.gettext_with_context', translation, text, context, domain);
|
|
302
|
-
return
|
|
302
|
+
return /** @type {string} */(
|
|
303
303
|
/** @type {*} */hooks.applyFilters('i18n.gettext_with_context_' + getFilterDomain(domain), translation, text, context, domain)
|
|
304
304
|
);
|
|
305
305
|
};
|
|
@@ -322,7 +322,7 @@ export const createI18n = (initialData, initialDomain, hooks) => {
|
|
|
322
322
|
*/
|
|
323
323
|
translation = /** @type {string} */
|
|
324
324
|
/** @type {*} */hooks.applyFilters('i18n.ngettext', translation, single, plural, number, domain);
|
|
325
|
-
return
|
|
325
|
+
return /** @type {string} */(
|
|
326
326
|
/** @type {*} */hooks.applyFilters('i18n.ngettext_' + getFilterDomain(domain), translation, single, plural, number, domain)
|
|
327
327
|
);
|
|
328
328
|
};
|
|
@@ -346,7 +346,7 @@ export const createI18n = (initialData, initialDomain, hooks) => {
|
|
|
346
346
|
*/
|
|
347
347
|
translation = /** @type {string} */
|
|
348
348
|
/** @type {*} */hooks.applyFilters('i18n.ngettext_with_context', translation, single, plural, number, context, domain);
|
|
349
|
-
return
|
|
349
|
+
return /** @type {string} */(
|
|
350
350
|
/** @type {*} */hooks.applyFilters('i18n.ngettext_with_context_' + getFilterDomain(domain), translation, single, plural, number, context, domain)
|
|
351
351
|
);
|
|
352
352
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/i18n",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.51.0",
|
|
4
4
|
"description": "WordPress internationalization (i18n) library.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/runtime": "^7.16.0",
|
|
33
|
-
"@wordpress/hooks": "^3.
|
|
33
|
+
"@wordpress/hooks": "^3.51.0",
|
|
34
34
|
"gettext-parser": "^1.3.1",
|
|
35
35
|
"memize": "^2.1.0",
|
|
36
36
|
"sprintf-js": "^1.1.1",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "eb796371e9630636a4a8837033807b0c4a06ed67"
|
|
43
43
|
}
|