@lingui/core 3.11.0 → 3.13.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/cjs/core.development.js +19 -5
- package/cjs/core.development.js.map +1 -1
- package/cjs/core.production.min.js +1 -1
- package/cjs/dev.development.js +19 -5
- package/cjs/dev.development.js.map +1 -1
- package/cjs/dev.production.min.js +1 -1
- package/cjs/i18n.d.ts +6 -3
- package/cjs/i18n.d.ts.map +1 -1
- package/esm/core.development.js +19 -5
- package/esm/core.development.js.map +1 -1
- package/esm/core.production.min.js +1 -1
- package/esm/dev.development.js +19 -5
- package/esm/dev.development.js.map +1 -1
- package/esm/dev.production.min.js +1 -1
- package/esm/i18n.d.ts +6 -3
- package/esm/i18n.d.ts.map +1 -1
- package/package.json +1 -1
package/cjs/core.development.js
CHANGED
|
@@ -443,29 +443,43 @@ var I18n = /*#__PURE__*/function (_EventEmitter) {
|
|
|
443
443
|
|
|
444
444
|
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
445
445
|
message = _ref.message,
|
|
446
|
-
formats = _ref.formats
|
|
446
|
+
formats = _ref.formats,
|
|
447
|
+
context = _ref.context;
|
|
447
448
|
|
|
448
449
|
if (!isString(id)) {
|
|
449
450
|
values = id.values || values;
|
|
450
451
|
message = id.message;
|
|
452
|
+
context = id.context;
|
|
451
453
|
id = id.id;
|
|
452
454
|
}
|
|
453
455
|
|
|
454
|
-
var
|
|
456
|
+
var messageMissing = !context && !this.messages[id];
|
|
457
|
+
var contextualMessageMissing = context && !this.messages[context][id];
|
|
458
|
+
var messageUnreachable = contextualMessageMissing || messageMissing; // replace missing messages with custom message for debugging
|
|
455
459
|
|
|
456
460
|
var missing = this._missing;
|
|
457
461
|
|
|
458
|
-
if (missing &&
|
|
459
|
-
return isFunction(missing) ? missing(this.locale, id) : missing;
|
|
462
|
+
if (missing && messageUnreachable) {
|
|
463
|
+
return isFunction(missing) ? missing(this.locale, id, context) : missing;
|
|
460
464
|
}
|
|
461
465
|
|
|
462
|
-
if (
|
|
466
|
+
if (messageUnreachable) {
|
|
463
467
|
this.emit("missing", {
|
|
464
468
|
id: id,
|
|
469
|
+
context: context,
|
|
465
470
|
locale: this._locale
|
|
466
471
|
});
|
|
467
472
|
}
|
|
468
473
|
|
|
474
|
+
var translation;
|
|
475
|
+
|
|
476
|
+
if (context && !contextualMessageMissing) {
|
|
477
|
+
// context is like a subdirectory of other keys
|
|
478
|
+
translation = this.messages[context][id] || message || id;
|
|
479
|
+
} else {
|
|
480
|
+
translation = this.messages[id] || message || id;
|
|
481
|
+
}
|
|
482
|
+
|
|
469
483
|
{
|
|
470
484
|
translation = isString(translation) ? compile(translation) : translation;
|
|
471
485
|
} // hack for parsing unicode values inside a string to get parsed in react native environments
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),n=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),l=require("@babel/runtime/helpers/slicedToArray"),o=require("@babel/runtime/helpers/objectWithoutProperties");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(e),u=i(t),c=i(r),f=i(n),h=i(a),v=i(l),d=i(o),m=function(e){return"string"==typeof e},g=function(e){return"function"==typeof e},y=new Map,p=new Map;function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(m(n)&&(n=new Date(n)),r){var a=D(e,t),l=p.get(a);if(l)return l.format(n);var o=new Intl.DateTimeFormat(e,t);return p.set(a,o),o.format(n)}var i=new Intl.DateTimeFormat(e,t);return i.format(n)}}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(r){var a=D(e,t),l=y.get(a);if(l)return l.format(n);var o=new Intl.NumberFormat(e,t);return y.set(a,o),o.format(n)}var i=new Intl.NumberFormat(e,t);return i.format(n)}}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Array.isArray(e)?e.sort().join("-"):e;return"".concat(r,"-").concat(JSON.stringify(t))}var k=Object.freeze({__proto__:null,date:_,number:b}),A=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;function O(e){var t=e.locale,r=e.locales,n=e.values,a=e.formats,l=e.localeData,o=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{plurals:void 0},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=t||e;var a=r.plurals,l=function(e){return m(e)?n[e]||{style:e}:e},o=function(e,r){return function(n){var a=g(r)?r(n):r,l=Array.isArray(a)?a:[a],o=b(t)(e);return l.map((function(e){return m(e)?e.replace("#",o):e}))}};return a||console.error("Plurals for locale ".concat(e," aren't loaded. Use i18n.loadLocaleData method to load plurals for specific locale. Using other plural rule as a fallback.")),{plural:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n)]||l.other;return o(e-n,i)},selectordinal:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n,!0)]||l.other;return o(e-n,i)},select:function(e,t){return t[e]||t.other},number:function(e,r){return b(t,l(r))(e)},date:function(e,r){return _(t,l(r))(e)},undefined:function(e){return e}}}(t,r,l,a);return function e(t,r,a){var l=n[t],i=o[r](l,a),s=g(i)?i(e):i;return Array.isArray(s)?s.join(""):s}}function j(e,t,r,n){return function(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=O({locale:t,locales:r,localeData:n,formats:l,values:a}),i=function e(t){return Array.isArray(t)?t.reduce((function(t,r){if(m(r))return t+r;var n=v.default(r,3),a=n[0],l=n[1],i=n[2],s={};null==i||m(i)?s=i:Object.keys(i).forEach((function(t){s[t]=e(i[t])}));var u=o(a,l,s);return null==u?t:t+u}),""):t},s=i(e);return m(s)&&A.test(s)?JSON.parse('"'.concat(s.trim(),'"')):m(s)?s.trim():s}}var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),n=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),l=require("@babel/runtime/helpers/slicedToArray"),o=require("@babel/runtime/helpers/objectWithoutProperties");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(e),u=i(t),c=i(r),f=i(n),h=i(a),v=i(l),d=i(o),m=function(e){return"string"==typeof e},g=function(e){return"function"==typeof e},y=new Map,p=new Map;function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(m(n)&&(n=new Date(n)),r){var a=D(e,t),l=p.get(a);if(l)return l.format(n);var o=new Intl.DateTimeFormat(e,t);return p.set(a,o),o.format(n)}var i=new Intl.DateTimeFormat(e,t);return i.format(n)}}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(r){var a=D(e,t),l=y.get(a);if(l)return l.format(n);var o=new Intl.NumberFormat(e,t);return y.set(a,o),o.format(n)}var i=new Intl.NumberFormat(e,t);return i.format(n)}}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Array.isArray(e)?e.sort().join("-"):e;return"".concat(r,"-").concat(JSON.stringify(t))}var k=Object.freeze({__proto__:null,date:_,number:b}),A=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;function O(e){var t=e.locale,r=e.locales,n=e.values,a=e.formats,l=e.localeData,o=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{plurals:void 0},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=t||e;var a=r.plurals,l=function(e){return m(e)?n[e]||{style:e}:e},o=function(e,r){return function(n){var a=g(r)?r(n):r,l=Array.isArray(a)?a:[a],o=b(t)(e);return l.map((function(e){return m(e)?e.replace("#",o):e}))}};return a||console.error("Plurals for locale ".concat(e," aren't loaded. Use i18n.loadLocaleData method to load plurals for specific locale. Using other plural rule as a fallback.")),{plural:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n)]||l.other;return o(e-n,i)},selectordinal:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n,!0)]||l.other;return o(e-n,i)},select:function(e,t){return t[e]||t.other},number:function(e,r){return b(t,l(r))(e)},date:function(e,r){return _(t,l(r))(e)},undefined:function(e){return e}}}(t,r,l,a);return function e(t,r,a){var l=n[t],i=o[r](l,a),s=g(i)?i(e):i;return Array.isArray(s)?s.join(""):s}}function j(e,t,r,n){return function(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=O({locale:t,locales:r,localeData:n,formats:l,values:a}),i=function e(t){return Array.isArray(t)?t.reduce((function(t,r){if(m(r))return t+r;var n=v.default(r,3),a=n[0],l=n[1],i=n[2],s={};null==i||m(i)?s=i:Object.keys(i).forEach((function(t){s[t]=e(i[t])}));var u=o(a,l,s);return null==u?t:t+u}),""):t},s=i(e);return m(s)&&A.test(s)?JSON.parse('"'.concat(s.trim(),'"')):m(s)?s.trim():s}}var x=function(){function e(){s.default(this,e),this._events={}}return u.default(e,[{key:"on",value:function(e,t){var r=this;return this._hasEvent(e)||(this._events[e]=[]),this._events[e].push(t),function(){return r.removeListener(e,t)}}},{key:"removeListener",value:function(e,t){if(this._hasEvent(e)){var r=this._events[e].indexOf(t);~r&&this._events[e].splice(r,1)}}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];this._hasEvent(e)&&this._events[e].map((function(e){return e.apply(t,n)}))}},{key:"_hasEvent",value:function(e){return Array.isArray(this._events[e])}}]),e}();function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h.default(e);if(t){var a=h.default(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return f.default(this,r)}}var L=function(e){c.default(r,e);var t=w(r);function r(e){var n;return s.default(this,r),n=t.call(this),n._messages={},n._localeData={},null!=e.missing&&(n._missing=e.missing),null!=e.messages&&n.load(e.messages),null!=e.localeData&&n.loadLocaleData(e.localeData),null==e.locale&&null==e.locales||n.activate(e.locale,e.locales),n}return u.default(r,[{key:"_loadLocaleData",value:function(e,t){null==this._localeData[e]?this._localeData[e]=t:Object.assign(this._localeData[e],t)}},{key:"loadLocaleData",value:function(e,t){var r=this;null!=t?this._loadLocaleData(e,t):Object.keys(e).forEach((function(t){return r._loadLocaleData(t,e[t])})),this.emit("change")}},{key:"_load",value:function(e,t){null==this._messages[e]?this._messages[e]=t:Object.assign(this._messages[e],t)}},{key:"load",value:function(e,t){var r=this;null!=t?this._load(e,t):Object.keys(e).forEach((function(t){return r._load(t,e[t])})),this.emit("change")}},{key:"activate",value:function(e,t){this._locale=e,this._locales=t,this.emit("change")}},{key:"_",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.message,a=r.formats,l=r.context;m(e)||(t=e.values||t,n=e.message,l=e.context,e=e.id);var o,i=!l&&!this.messages[e],s=l&&!this.messages[l][e],u=s||i,c=this._missing;return c&&u?g(c)?c(this.locale,e,l):c:(u&&this.emit("missing",{id:e,context:l,locale:this._locale}),o=l&&!s?this.messages[l][e]||n||e:this.messages[e]||n||e,m(o)&&A.test(o)?JSON.parse('"'.concat(o,'"')):m(o)?o:j(o,this.locale,this.locales,this.localeData)(t,a))}},{key:"date",value:function(e,t){return _(this.locales||this.locale,t)(e)}},{key:"number",value:function(e,t){return b(this.locales||this.locale,t)(e)}},{key:"locale",get:function(){return this._locale}},{key:"locales",get:function(){return this._locales}},{key:"messages",get:function(){var e;return null!==(e=this._messages[this._locale])&&void 0!==e?e:{}}},{key:"localeData",get:function(){var e;return null!==(e=this._localeData[this._locale])&&void 0!==e?e:{}}}]),r}(x);function q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new L(e)}var E=q();exports.I18n=L,exports.formats=k,exports.i18n=E,exports.setupI18n=q;
|
|
2
2
|
//# sourceMappingURL=core.production.min.js.map
|
package/cjs/dev.development.js
CHANGED
|
@@ -443,29 +443,43 @@ var I18n = /*#__PURE__*/function (_EventEmitter) {
|
|
|
443
443
|
|
|
444
444
|
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
445
445
|
message = _ref.message,
|
|
446
|
-
formats = _ref.formats
|
|
446
|
+
formats = _ref.formats,
|
|
447
|
+
context = _ref.context;
|
|
447
448
|
|
|
448
449
|
if (!isString(id)) {
|
|
449
450
|
values = id.values || values;
|
|
450
451
|
message = id.message;
|
|
452
|
+
context = id.context;
|
|
451
453
|
id = id.id;
|
|
452
454
|
}
|
|
453
455
|
|
|
454
|
-
var
|
|
456
|
+
var messageMissing = !context && !this.messages[id];
|
|
457
|
+
var contextualMessageMissing = context && !this.messages[context][id];
|
|
458
|
+
var messageUnreachable = contextualMessageMissing || messageMissing; // replace missing messages with custom message for debugging
|
|
455
459
|
|
|
456
460
|
var missing = this._missing;
|
|
457
461
|
|
|
458
|
-
if (missing &&
|
|
459
|
-
return isFunction(missing) ? missing(this.locale, id) : missing;
|
|
462
|
+
if (missing && messageUnreachable) {
|
|
463
|
+
return isFunction(missing) ? missing(this.locale, id, context) : missing;
|
|
460
464
|
}
|
|
461
465
|
|
|
462
|
-
if (
|
|
466
|
+
if (messageUnreachable) {
|
|
463
467
|
this.emit("missing", {
|
|
464
468
|
id: id,
|
|
469
|
+
context: context,
|
|
465
470
|
locale: this._locale
|
|
466
471
|
});
|
|
467
472
|
}
|
|
468
473
|
|
|
474
|
+
var translation;
|
|
475
|
+
|
|
476
|
+
if (context && !contextualMessageMissing) {
|
|
477
|
+
// context is like a subdirectory of other keys
|
|
478
|
+
translation = this.messages[context][id] || message || id;
|
|
479
|
+
} else {
|
|
480
|
+
translation = this.messages[id] || message || id;
|
|
481
|
+
}
|
|
482
|
+
|
|
469
483
|
{
|
|
470
484
|
translation = isString(translation) ? compile(translation) : translation;
|
|
471
485
|
} // hack for parsing unicode values inside a string to get parsed in react native environments
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),n=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),l=require("@babel/runtime/helpers/slicedToArray"),o=require("@babel/runtime/helpers/objectWithoutProperties");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(e),u=i(t),c=i(r),f=i(n),h=i(a),v=i(l),d=i(o),m=function(e){return"string"==typeof e},g=function(e){return"function"==typeof e},y=new Map,p=new Map;function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(m(n)&&(n=new Date(n)),r){var a=D(e,t),l=p.get(a);if(l)return l.format(n);var o=new Intl.DateTimeFormat(e,t);return p.set(a,o),o.format(n)}var i=new Intl.DateTimeFormat(e,t);return i.format(n)}}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(r){var a=D(e,t),l=y.get(a);if(l)return l.format(n);var o=new Intl.NumberFormat(e,t);return y.set(a,o),o.format(n)}var i=new Intl.NumberFormat(e,t);return i.format(n)}}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Array.isArray(e)?e.sort().join("-"):e;return"".concat(r,"-").concat(JSON.stringify(t))}var k=Object.freeze({__proto__:null,date:_,number:b}),A=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;function O(e){var t=e.locale,r=e.locales,n=e.values,a=e.formats,l=e.localeData,o=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{plurals:void 0},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=t||e;var a=r.plurals,l=function(e){return m(e)?n[e]||{style:e}:e},o=function(e,r){return function(n){var a=g(r)?r(n):r,l=Array.isArray(a)?a:[a],o=b(t)(e);return l.map((function(e){return m(e)?e.replace("#",o):e}))}};return a||console.error("Plurals for locale ".concat(e," aren't loaded. Use i18n.loadLocaleData method to load plurals for specific locale. Using other plural rule as a fallback.")),{plural:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n)]||l.other;return o(e-n,i)},selectordinal:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n,!0)]||l.other;return o(e-n,i)},select:function(e,t){return t[e]||t.other},number:function(e,r){return b(t,l(r))(e)},date:function(e,r){return _(t,l(r))(e)},undefined:function(e){return e}}}(t,r,l,a);return function e(t,r,a){var l=n[t],i=o[r](l,a),s=g(i)?i(e):i;return Array.isArray(s)?s.join(""):s}}function j(e,t,r,n){return function(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=O({locale:t,locales:r,localeData:n,formats:l,values:a}),i=function e(t){return Array.isArray(t)?t.reduce((function(t,r){if(m(r))return t+r;var n=v.default(r,3),a=n[0],l=n[1],i=n[2],s={};null==i||m(i)?s=i:Object.keys(i).forEach((function(t){s[t]=e(i[t])}));var u=o(a,l,s);return null==u?t:t+u}),""):t},s=i(e);return m(s)&&A.test(s)?JSON.parse('"'.concat(s.trim(),'"')):m(s)?s.trim():s}}var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),n=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),l=require("@babel/runtime/helpers/slicedToArray"),o=require("@babel/runtime/helpers/objectWithoutProperties");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(e),u=i(t),c=i(r),f=i(n),h=i(a),v=i(l),d=i(o),m=function(e){return"string"==typeof e},g=function(e){return"function"==typeof e},y=new Map,p=new Map;function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(m(n)&&(n=new Date(n)),r){var a=D(e,t),l=p.get(a);if(l)return l.format(n);var o=new Intl.DateTimeFormat(e,t);return p.set(a,o),o.format(n)}var i=new Intl.DateTimeFormat(e,t);return i.format(n)}}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(r){var a=D(e,t),l=y.get(a);if(l)return l.format(n);var o=new Intl.NumberFormat(e,t);return y.set(a,o),o.format(n)}var i=new Intl.NumberFormat(e,t);return i.format(n)}}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Array.isArray(e)?e.sort().join("-"):e;return"".concat(r,"-").concat(JSON.stringify(t))}var k=Object.freeze({__proto__:null,date:_,number:b}),A=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;function O(e){var t=e.locale,r=e.locales,n=e.values,a=e.formats,l=e.localeData,o=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{plurals:void 0},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=t||e;var a=r.plurals,l=function(e){return m(e)?n[e]||{style:e}:e},o=function(e,r){return function(n){var a=g(r)?r(n):r,l=Array.isArray(a)?a:[a],o=b(t)(e);return l.map((function(e){return m(e)?e.replace("#",o):e}))}};return a||console.error("Plurals for locale ".concat(e," aren't loaded. Use i18n.loadLocaleData method to load plurals for specific locale. Using other plural rule as a fallback.")),{plural:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n)]||l.other;return o(e-n,i)},selectordinal:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n,!0)]||l.other;return o(e-n,i)},select:function(e,t){return t[e]||t.other},number:function(e,r){return b(t,l(r))(e)},date:function(e,r){return _(t,l(r))(e)},undefined:function(e){return e}}}(t,r,l,a);return function e(t,r,a){var l=n[t],i=o[r](l,a),s=g(i)?i(e):i;return Array.isArray(s)?s.join(""):s}}function j(e,t,r,n){return function(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=O({locale:t,locales:r,localeData:n,formats:l,values:a}),i=function e(t){return Array.isArray(t)?t.reduce((function(t,r){if(m(r))return t+r;var n=v.default(r,3),a=n[0],l=n[1],i=n[2],s={};null==i||m(i)?s=i:Object.keys(i).forEach((function(t){s[t]=e(i[t])}));var u=o(a,l,s);return null==u?t:t+u}),""):t},s=i(e);return m(s)&&A.test(s)?JSON.parse('"'.concat(s.trim(),'"')):m(s)?s.trim():s}}var x=function(){function e(){s.default(this,e),this._events={}}return u.default(e,[{key:"on",value:function(e,t){var r=this;return this._hasEvent(e)||(this._events[e]=[]),this._events[e].push(t),function(){return r.removeListener(e,t)}}},{key:"removeListener",value:function(e,t){if(this._hasEvent(e)){var r=this._events[e].indexOf(t);~r&&this._events[e].splice(r,1)}}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];this._hasEvent(e)&&this._events[e].map((function(e){return e.apply(t,n)}))}},{key:"_hasEvent",value:function(e){return Array.isArray(this._events[e])}}]),e}();function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h.default(e);if(t){var a=h.default(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return f.default(this,r)}}var L=function(e){c.default(r,e);var t=w(r);function r(e){var n;return s.default(this,r),n=t.call(this),n._messages={},n._localeData={},null!=e.missing&&(n._missing=e.missing),null!=e.messages&&n.load(e.messages),null!=e.localeData&&n.loadLocaleData(e.localeData),null==e.locale&&null==e.locales||n.activate(e.locale,e.locales),n}return u.default(r,[{key:"_loadLocaleData",value:function(e,t){null==this._localeData[e]?this._localeData[e]=t:Object.assign(this._localeData[e],t)}},{key:"loadLocaleData",value:function(e,t){var r=this;null!=t?this._loadLocaleData(e,t):Object.keys(e).forEach((function(t){return r._loadLocaleData(t,e[t])})),this.emit("change")}},{key:"_load",value:function(e,t){null==this._messages[e]?this._messages[e]=t:Object.assign(this._messages[e],t)}},{key:"load",value:function(e,t){var r=this;null!=t?this._load(e,t):Object.keys(e).forEach((function(t){return r._load(t,e[t])})),this.emit("change")}},{key:"activate",value:function(e,t){this._locale=e,this._locales=t,this.emit("change")}},{key:"_",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.message,a=r.formats,l=r.context;m(e)||(t=e.values||t,n=e.message,l=e.context,e=e.id);var o,i=!l&&!this.messages[e],s=l&&!this.messages[l][e],u=s||i,c=this._missing;return c&&u?g(c)?c(this.locale,e,l):c:(u&&this.emit("missing",{id:e,context:l,locale:this._locale}),o=l&&!s?this.messages[l][e]||n||e:this.messages[e]||n||e,m(o)&&A.test(o)?JSON.parse('"'.concat(o,'"')):m(o)?o:j(o,this.locale,this.locales,this.localeData)(t,a))}},{key:"date",value:function(e,t){return _(this.locales||this.locale,t)(e)}},{key:"number",value:function(e,t){return b(this.locales||this.locale,t)(e)}},{key:"locale",get:function(){return this._locale}},{key:"locales",get:function(){return this._locales}},{key:"messages",get:function(){var e;return null!==(e=this._messages[this._locale])&&void 0!==e?e:{}}},{key:"localeData",get:function(){var e;return null!==(e=this._localeData[this._locale])&&void 0!==e?e:{}}}]),r}(x);function q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new L(e)}var E=q();exports.I18n=L,exports.formats=k,exports.i18n=E,exports.setupI18n=q;
|
|
2
2
|
//# sourceMappingURL=dev.production.min.js.map
|
package/cjs/i18n.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from "./eventEmitter";
|
|
2
2
|
export declare type MessageOptions = {
|
|
3
3
|
message?: string;
|
|
4
|
+
context?: string;
|
|
4
5
|
formats?: Object;
|
|
5
6
|
};
|
|
6
7
|
export declare type Locale = string;
|
|
@@ -16,18 +17,20 @@ export declare type MessageDescriptor = {
|
|
|
16
17
|
id?: string;
|
|
17
18
|
comment?: string;
|
|
18
19
|
message?: string;
|
|
20
|
+
context?: string;
|
|
19
21
|
values?: Record<string, unknown>;
|
|
20
22
|
};
|
|
21
23
|
export declare type MissingMessageEvent = {
|
|
22
24
|
locale: Locale;
|
|
23
25
|
id: string;
|
|
26
|
+
context?: string;
|
|
24
27
|
};
|
|
25
28
|
declare type setupI18nProps = {
|
|
26
29
|
locale?: Locale;
|
|
27
30
|
locales?: Locales;
|
|
28
31
|
messages?: AllMessages;
|
|
29
32
|
localeData?: AllLocaleData;
|
|
30
|
-
missing?: string | ((message: any, id: any) => string);
|
|
33
|
+
missing?: string | ((message: any, id: any, context: any) => string);
|
|
31
34
|
};
|
|
32
35
|
declare type Events = {
|
|
33
36
|
change: () => void;
|
|
@@ -38,7 +41,7 @@ export declare class I18n extends EventEmitter<Events> {
|
|
|
38
41
|
_locales: Locales;
|
|
39
42
|
_localeData: AllLocaleData;
|
|
40
43
|
_messages: AllMessages;
|
|
41
|
-
_missing: string | ((message: any, id: any) => string);
|
|
44
|
+
_missing: string | ((message: any, id: any, context: any) => string);
|
|
42
45
|
constructor(params: setupI18nProps);
|
|
43
46
|
get locale(): string;
|
|
44
47
|
get locales(): Locales;
|
|
@@ -51,7 +54,7 @@ export declare class I18n extends EventEmitter<Events> {
|
|
|
51
54
|
load(allMessages: AllMessages): void;
|
|
52
55
|
load(locale: Locale, messages: Messages): void;
|
|
53
56
|
activate(locale: Locale, locales?: Locales): void;
|
|
54
|
-
_(id: MessageDescriptor | string, values?: Object | undefined, { message, formats }?: MessageOptions | undefined): string;
|
|
57
|
+
_(id: MessageDescriptor | string, values?: Object | undefined, { message, formats, context }?: MessageOptions | undefined): string;
|
|
55
58
|
date(value: string | Date, format?: Intl.DateTimeFormatOptions): string;
|
|
56
59
|
number(value: number, format?: Intl.NumberFormatOptions): string;
|
|
57
60
|
}
|
package/cjs/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["packages/core/src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AE,cAAc,GAAG,SAAc;IAmDhE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG,MAAM;IAIvE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,mBAAmB,GAAG,MAAM;CAGjE;AAED,iBAAS,SAAS,CAAC,MAAM,GAAE,cAAmB,GAAG,IAAI,CAEpD;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
package/esm/core.development.js
CHANGED
|
@@ -428,29 +428,43 @@ var I18n = /*#__PURE__*/function (_EventEmitter) {
|
|
|
428
428
|
|
|
429
429
|
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
430
430
|
message = _ref.message,
|
|
431
|
-
formats = _ref.formats
|
|
431
|
+
formats = _ref.formats,
|
|
432
|
+
context = _ref.context;
|
|
432
433
|
|
|
433
434
|
if (!isString(id)) {
|
|
434
435
|
values = id.values || values;
|
|
435
436
|
message = id.message;
|
|
437
|
+
context = id.context;
|
|
436
438
|
id = id.id;
|
|
437
439
|
}
|
|
438
440
|
|
|
439
|
-
var
|
|
441
|
+
var messageMissing = !context && !this.messages[id];
|
|
442
|
+
var contextualMessageMissing = context && !this.messages[context][id];
|
|
443
|
+
var messageUnreachable = contextualMessageMissing || messageMissing; // replace missing messages with custom message for debugging
|
|
440
444
|
|
|
441
445
|
var missing = this._missing;
|
|
442
446
|
|
|
443
|
-
if (missing &&
|
|
444
|
-
return isFunction(missing) ? missing(this.locale, id) : missing;
|
|
447
|
+
if (missing && messageUnreachable) {
|
|
448
|
+
return isFunction(missing) ? missing(this.locale, id, context) : missing;
|
|
445
449
|
}
|
|
446
450
|
|
|
447
|
-
if (
|
|
451
|
+
if (messageUnreachable) {
|
|
448
452
|
this.emit("missing", {
|
|
449
453
|
id: id,
|
|
454
|
+
context: context,
|
|
450
455
|
locale: this._locale
|
|
451
456
|
});
|
|
452
457
|
}
|
|
453
458
|
|
|
459
|
+
var translation;
|
|
460
|
+
|
|
461
|
+
if (context && !contextualMessageMissing) {
|
|
462
|
+
// context is like a subdirectory of other keys
|
|
463
|
+
translation = this.messages[context][id] || message || id;
|
|
464
|
+
} else {
|
|
465
|
+
translation = this.messages[id] || message || id;
|
|
466
|
+
}
|
|
467
|
+
|
|
454
468
|
{
|
|
455
469
|
translation = isString(translation) ? compile(translation) : translation;
|
|
456
470
|
} // hack for parsing unicode values inside a string to get parsed in react native environments
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import o from"@babel/runtime/helpers/slicedToArray";import l from"@babel/runtime/helpers/objectWithoutProperties";var i=function(e){return"string"==typeof e},s=function(e){return"function"==typeof e},u=new Map,c=new Map;function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(r){if(i(r)&&(r=new Date(r)),n){var a=v(e,t),o=c.get(a);if(o)return o.format(r);var l=new Intl.DateTimeFormat(e,t);return c.set(a,l),l.format(r)}var s=new Intl.DateTimeFormat(e,t);return s.format(r)}}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(r){if(n){var a=v(e,t),o=u.get(a);if(o)return o.format(r);var l=new Intl.NumberFormat(e,t);return u.set(a,l),l.format(r)}var i=new Intl.NumberFormat(e,t);return i.format(r)}}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(e)?e.sort().join("-"):e;return"".concat(n,"-").concat(JSON.stringify(t))}var m=Object.freeze({__proto__:null,date:f,number:h}),g=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;function d(e){var t=e.locale,n=e.locales,r=e.values,a=e.formats,o=e.localeData,u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{plurals:void 0},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=t||e;var a=n.plurals,o=function(e){return i(e)?r[e]||{style:e}:e},u=function(e,n){return function(r){var a=s(n)?n(r):n,o=Array.isArray(a)?a:[a],l=h(t)(e);return o.map((function(e){return i(e)?e.replace("#",l):e}))}};return a||console.error("Plurals for locale ".concat(e," aren't loaded. Use i18n.loadLocaleData method to load plurals for specific locale. Using other plural rule as a fallback.")),{plural:function(e,t){var n=t.offset,r=void 0===n?0:n,o=l(t,["offset"]),i=o[e]||o[null==a?void 0:a(e-r)]||o.other;return u(e-r,i)},selectordinal:function(e,t){var n=t.offset,r=void 0===n?0:n,o=l(t,["offset"]),i=o[e]||o[null==a?void 0:a(e-r,!0)]||o.other;return u(e-r,i)},select:function(e,t){return t[e]||t.other},number:function(e,n){return h(t,o(n))(e)},date:function(e,n){return f(t,o(n))(e)},undefined:function(e){return e}}}(t,n,o,a);return function e(t,n,a){var o=r[t],l=u[n](o,a),i=s(l)?l(e):l;return Array.isArray(i)?i.join(""):i}}function p(e,t,n,r){return function(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=d({locale:t,locales:n,localeData:r,formats:l,values:a}),u=function e(t){return Array.isArray(t)?t.reduce((function(t,n){if(i(n))return t+n;var r=o(n,3),a=r[0],l=r[1],u=r[2],c={};null==u||i(u)?c=u:Object.keys(u).forEach((function(t){c[t]=e(u[t])}));var f=s(a,l,c);return null==f?t:t+f}),""):t},c=u(e);return i(c)&&g.test(c)?JSON.parse('"'.concat(c.trim(),'"')):i(c)?c.trim():c}}var y=function(){function n(){e(this,n),this._events={}}return t(n,[{key:"on",value:function(e,t){var n=this;return this._hasEvent(e)||(this._events[e]=[]),this._events[e].push(t),function(){return n.removeListener(e,t)}}},{key:"removeListener",value:function(e,t){if(this._hasEvent(e)){var n=this._events[e].indexOf(t);~n&&this._events[e].splice(n,1)}}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];this._hasEvent(e)&&this._events[e].map((function(e){return e.apply(t,r)}))}},{key:"_hasEvent",value:function(e){return Array.isArray(this._events[e])}}]),n}();function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=a(e);if(t){var l=a(this).constructor;n=Reflect.construct(o,arguments,l)}else n=o.apply(this,arguments);return r(this,n)}}var b=function(r){n(o,r);var a=_(o);function o(t){var n;return e(this,o),n=a.call(this),n._messages={},n._localeData={},null!=t.missing&&(n._missing=t.missing),null!=t.messages&&n.load(t.messages),null!=t.localeData&&n.loadLocaleData(t.localeData),null==t.locale&&null==t.locales||n.activate(t.locale,t.locales),n}return t(o,[{key:"_loadLocaleData",value:function(e,t){null==this._localeData[e]?this._localeData[e]=t:Object.assign(this._localeData[e],t)}},{key:"loadLocaleData",value:function(e,t){var n=this;null!=t?this._loadLocaleData(e,t):Object.keys(e).forEach((function(t){return n._loadLocaleData(t,e[t])})),this.emit("change")}},{key:"_load",value:function(e,t){null==this._messages[e]?this._messages[e]=t:Object.assign(this._messages[e],t)}},{key:"load",value:function(e,t){var n=this;null!=t?this._load(e,t):Object.keys(e).forEach((function(t){return n._load(t,e[t])})),this.emit("change")}},{key:"activate",value:function(e,t){this._locale=e,this._locales=t,this.emit("change")}},{key:"_",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.message,a=n.formats,o=n.context;i(e)||(t=e.values||t,r=e.message,o=e.context,e=e.id);var l,u=!o&&!this.messages[e],c=o&&!this.messages[o][e],f=c||u,h=this._missing;return h&&f?s(h)?h(this.locale,e,o):h:(f&&this.emit("missing",{id:e,context:o,locale:this._locale}),l=o&&!c?this.messages[o][e]||r||e:this.messages[e]||r||e,i(l)&&g.test(l)?JSON.parse('"'.concat(l,'"')):i(l)?l:p(l,this.locale,this.locales,this.localeData)(t,a))}},{key:"date",value:function(e,t){return f(this.locales||this.locale,t)(e)}},{key:"number",value:function(e,t){return h(this.locales||this.locale,t)(e)}},{key:"locale",get:function(){return this._locale}},{key:"locales",get:function(){return this._locales}},{key:"messages",get:function(){var e;return null!==(e=this._messages[this._locale])&&void 0!==e?e:{}}},{key:"localeData",get:function(){var e;return null!==(e=this._localeData[this._locale])&&void 0!==e?e:{}}}]),o}(y);function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new b(e)}var k=D();export{b as I18n,m as formats,k as i18n,D as setupI18n};
|
|
2
2
|
//# sourceMappingURL=core.production.min.js.map
|
package/esm/dev.development.js
CHANGED
|
@@ -428,29 +428,43 @@ var I18n = /*#__PURE__*/function (_EventEmitter) {
|
|
|
428
428
|
|
|
429
429
|
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
430
430
|
message = _ref.message,
|
|
431
|
-
formats = _ref.formats
|
|
431
|
+
formats = _ref.formats,
|
|
432
|
+
context = _ref.context;
|
|
432
433
|
|
|
433
434
|
if (!isString(id)) {
|
|
434
435
|
values = id.values || values;
|
|
435
436
|
message = id.message;
|
|
437
|
+
context = id.context;
|
|
436
438
|
id = id.id;
|
|
437
439
|
}
|
|
438
440
|
|
|
439
|
-
var
|
|
441
|
+
var messageMissing = !context && !this.messages[id];
|
|
442
|
+
var contextualMessageMissing = context && !this.messages[context][id];
|
|
443
|
+
var messageUnreachable = contextualMessageMissing || messageMissing; // replace missing messages with custom message for debugging
|
|
440
444
|
|
|
441
445
|
var missing = this._missing;
|
|
442
446
|
|
|
443
|
-
if (missing &&
|
|
444
|
-
return isFunction(missing) ? missing(this.locale, id) : missing;
|
|
447
|
+
if (missing && messageUnreachable) {
|
|
448
|
+
return isFunction(missing) ? missing(this.locale, id, context) : missing;
|
|
445
449
|
}
|
|
446
450
|
|
|
447
|
-
if (
|
|
451
|
+
if (messageUnreachable) {
|
|
448
452
|
this.emit("missing", {
|
|
449
453
|
id: id,
|
|
454
|
+
context: context,
|
|
450
455
|
locale: this._locale
|
|
451
456
|
});
|
|
452
457
|
}
|
|
453
458
|
|
|
459
|
+
var translation;
|
|
460
|
+
|
|
461
|
+
if (context && !contextualMessageMissing) {
|
|
462
|
+
// context is like a subdirectory of other keys
|
|
463
|
+
translation = this.messages[context][id] || message || id;
|
|
464
|
+
} else {
|
|
465
|
+
translation = this.messages[id] || message || id;
|
|
466
|
+
}
|
|
467
|
+
|
|
454
468
|
{
|
|
455
469
|
translation = isString(translation) ? compile(translation) : translation;
|
|
456
470
|
} // hack for parsing unicode values inside a string to get parsed in react native environments
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import o from"@babel/runtime/helpers/slicedToArray";import l from"@babel/runtime/helpers/objectWithoutProperties";var i=function(e){return"string"==typeof e},s=function(e){return"function"==typeof e},u=new Map,c=new Map;function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(r){if(i(r)&&(r=new Date(r)),n){var a=v(e,t),o=c.get(a);if(o)return o.format(r);var l=new Intl.DateTimeFormat(e,t);return c.set(a,l),l.format(r)}var s=new Intl.DateTimeFormat(e,t);return s.format(r)}}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(r){if(n){var a=v(e,t),o=u.get(a);if(o)return o.format(r);var l=new Intl.NumberFormat(e,t);return u.set(a,l),l.format(r)}var i=new Intl.NumberFormat(e,t);return i.format(r)}}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(e)?e.sort().join("-"):e;return"".concat(n,"-").concat(JSON.stringify(t))}var m=Object.freeze({__proto__:null,date:f,number:h}),g=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;function d(e){var t=e.locale,n=e.locales,r=e.values,a=e.formats,o=e.localeData,u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{plurals:void 0},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=t||e;var a=n.plurals,o=function(e){return i(e)?r[e]||{style:e}:e},u=function(e,n){return function(r){var a=s(n)?n(r):n,o=Array.isArray(a)?a:[a],l=h(t)(e);return o.map((function(e){return i(e)?e.replace("#",l):e}))}};return a||console.error("Plurals for locale ".concat(e," aren't loaded. Use i18n.loadLocaleData method to load plurals for specific locale. Using other plural rule as a fallback.")),{plural:function(e,t){var n=t.offset,r=void 0===n?0:n,o=l(t,["offset"]),i=o[e]||o[null==a?void 0:a(e-r)]||o.other;return u(e-r,i)},selectordinal:function(e,t){var n=t.offset,r=void 0===n?0:n,o=l(t,["offset"]),i=o[e]||o[null==a?void 0:a(e-r,!0)]||o.other;return u(e-r,i)},select:function(e,t){return t[e]||t.other},number:function(e,n){return h(t,o(n))(e)},date:function(e,n){return f(t,o(n))(e)},undefined:function(e){return e}}}(t,n,o,a);return function e(t,n,a){var o=r[t],l=u[n](o,a),i=s(l)?l(e):l;return Array.isArray(i)?i.join(""):i}}function p(e,t,n,r){return function(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=d({locale:t,locales:n,localeData:r,formats:l,values:a}),u=function e(t){return Array.isArray(t)?t.reduce((function(t,n){if(i(n))return t+n;var r=o(n,3),a=r[0],l=r[1],u=r[2],c={};null==u||i(u)?c=u:Object.keys(u).forEach((function(t){c[t]=e(u[t])}));var f=s(a,l,c);return null==f?t:t+f}),""):t},c=u(e);return i(c)&&g.test(c)?JSON.parse('"'.concat(c.trim(),'"')):i(c)?c.trim():c}}var y=function(){function n(){e(this,n),this._events={}}return t(n,[{key:"on",value:function(e,t){var n=this;return this._hasEvent(e)||(this._events[e]=[]),this._events[e].push(t),function(){return n.removeListener(e,t)}}},{key:"removeListener",value:function(e,t){if(this._hasEvent(e)){var n=this._events[e].indexOf(t);~n&&this._events[e].splice(n,1)}}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];this._hasEvent(e)&&this._events[e].map((function(e){return e.apply(t,r)}))}},{key:"_hasEvent",value:function(e){return Array.isArray(this._events[e])}}]),n}();function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=a(e);if(t){var l=a(this).constructor;n=Reflect.construct(o,arguments,l)}else n=o.apply(this,arguments);return r(this,n)}}var b=function(r){n(o,r);var a=_(o);function o(t){var n;return e(this,o),n=a.call(this),n._messages={},n._localeData={},null!=t.missing&&(n._missing=t.missing),null!=t.messages&&n.load(t.messages),null!=t.localeData&&n.loadLocaleData(t.localeData),null==t.locale&&null==t.locales||n.activate(t.locale,t.locales),n}return t(o,[{key:"_loadLocaleData",value:function(e,t){null==this._localeData[e]?this._localeData[e]=t:Object.assign(this._localeData[e],t)}},{key:"loadLocaleData",value:function(e,t){var n=this;null!=t?this._loadLocaleData(e,t):Object.keys(e).forEach((function(t){return n._loadLocaleData(t,e[t])})),this.emit("change")}},{key:"_load",value:function(e,t){null==this._messages[e]?this._messages[e]=t:Object.assign(this._messages[e],t)}},{key:"load",value:function(e,t){var n=this;null!=t?this._load(e,t):Object.keys(e).forEach((function(t){return n._load(t,e[t])})),this.emit("change")}},{key:"activate",value:function(e,t){this._locale=e,this._locales=t,this.emit("change")}},{key:"_",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.message,a=n.formats,o=n.context;i(e)||(t=e.values||t,r=e.message,o=e.context,e=e.id);var l,u=!o&&!this.messages[e],c=o&&!this.messages[o][e],f=c||u,h=this._missing;return h&&f?s(h)?h(this.locale,e,o):h:(f&&this.emit("missing",{id:e,context:o,locale:this._locale}),l=o&&!c?this.messages[o][e]||r||e:this.messages[e]||r||e,i(l)&&g.test(l)?JSON.parse('"'.concat(l,'"')):i(l)?l:p(l,this.locale,this.locales,this.localeData)(t,a))}},{key:"date",value:function(e,t){return f(this.locales||this.locale,t)(e)}},{key:"number",value:function(e,t){return h(this.locales||this.locale,t)(e)}},{key:"locale",get:function(){return this._locale}},{key:"locales",get:function(){return this._locales}},{key:"messages",get:function(){var e;return null!==(e=this._messages[this._locale])&&void 0!==e?e:{}}},{key:"localeData",get:function(){var e;return null!==(e=this._localeData[this._locale])&&void 0!==e?e:{}}}]),o}(y);function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new b(e)}var k=D();export{b as I18n,m as formats,k as i18n,D as setupI18n};
|
|
2
2
|
//# sourceMappingURL=dev.production.min.js.map
|
package/esm/i18n.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from "./eventEmitter";
|
|
2
2
|
export declare type MessageOptions = {
|
|
3
3
|
message?: string;
|
|
4
|
+
context?: string;
|
|
4
5
|
formats?: Object;
|
|
5
6
|
};
|
|
6
7
|
export declare type Locale = string;
|
|
@@ -16,18 +17,20 @@ export declare type MessageDescriptor = {
|
|
|
16
17
|
id?: string;
|
|
17
18
|
comment?: string;
|
|
18
19
|
message?: string;
|
|
20
|
+
context?: string;
|
|
19
21
|
values?: Record<string, unknown>;
|
|
20
22
|
};
|
|
21
23
|
export declare type MissingMessageEvent = {
|
|
22
24
|
locale: Locale;
|
|
23
25
|
id: string;
|
|
26
|
+
context?: string;
|
|
24
27
|
};
|
|
25
28
|
declare type setupI18nProps = {
|
|
26
29
|
locale?: Locale;
|
|
27
30
|
locales?: Locales;
|
|
28
31
|
messages?: AllMessages;
|
|
29
32
|
localeData?: AllLocaleData;
|
|
30
|
-
missing?: string | ((message: any, id: any) => string);
|
|
33
|
+
missing?: string | ((message: any, id: any, context: any) => string);
|
|
31
34
|
};
|
|
32
35
|
declare type Events = {
|
|
33
36
|
change: () => void;
|
|
@@ -38,7 +41,7 @@ export declare class I18n extends EventEmitter<Events> {
|
|
|
38
41
|
_locales: Locales;
|
|
39
42
|
_localeData: AllLocaleData;
|
|
40
43
|
_messages: AllMessages;
|
|
41
|
-
_missing: string | ((message: any, id: any) => string);
|
|
44
|
+
_missing: string | ((message: any, id: any, context: any) => string);
|
|
42
45
|
constructor(params: setupI18nProps);
|
|
43
46
|
get locale(): string;
|
|
44
47
|
get locales(): Locales;
|
|
@@ -51,7 +54,7 @@ export declare class I18n extends EventEmitter<Events> {
|
|
|
51
54
|
load(allMessages: AllMessages): void;
|
|
52
55
|
load(locale: Locale, messages: Messages): void;
|
|
53
56
|
activate(locale: Locale, locales?: Locales): void;
|
|
54
|
-
_(id: MessageDescriptor | string, values?: Object | undefined, { message, formats }?: MessageOptions | undefined): string;
|
|
57
|
+
_(id: MessageDescriptor | string, values?: Object | undefined, { message, formats, context }?: MessageOptions | undefined): string;
|
|
55
58
|
date(value: string | Date, format?: Intl.DateTimeFormatOptions): string;
|
|
56
59
|
number(value: number, format?: Intl.NumberFormatOptions): string;
|
|
57
60
|
}
|
package/esm/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["packages/core/src/i18n.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,oBAAY,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,oBAAY,MAAM,GAAG,MAAM,CAAA;AAC3B,oBAAY,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;AAEvC,oBAAY,UAAU,GAAG;IACvB,OAAO,CAAC,EAAE,QAAQ,CAAA;CACnB,CAAA;AAED,oBAAY,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;AAEtD,oBAAY,eAAe,GACvB,MAAM,GACN,KAAK,CACH,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CACxE,CAAA;AAEL,oBAAY,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;AAEtD,oBAAY,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AAElD,oBAAY,iBAAiB,GAAG;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;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