@commercetools-frontend/i18n 20.10.3 → 20.12.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/dist/commercetools-frontend-i18n.cjs.dev.js +25 -27
- package/dist/commercetools-frontend-i18n.cjs.prod.js +25 -27
- package/dist/commercetools-frontend-i18n.esm.js +2 -2
- package/dist/de-8dc21940.cjs.dev.js +1 -1
- package/dist/de-d18314ca.cjs.prod.js +1 -1
- package/dist/declarations/src/version.d.ts +1 -1
- package/dist/en-82eb0e10.cjs.dev.js +1 -1
- package/dist/en-bab4abaf.cjs.prod.js +1 -1
- package/dist/es-6db3d54b.cjs.dev.js +1 -1
- package/dist/es-e06ffdef.cjs.prod.js +1 -1
- package/dist/fr-FR-398bae77.cjs.dev.js +1 -1
- package/dist/fr-FR-c5a88750.cjs.prod.js +1 -1
- package/dist/ja-794861c3.cjs.prod.js +1 -1
- package/dist/ja-87cbbc58.cjs.dev.js +1 -1
- package/dist/zh-CN-a022502f.cjs.prod.js +1 -1
- package/dist/zh-CN-e179b592.cjs.dev.js +1 -1
- package/package.json +8 -10
|
@@ -26,14 +26,12 @@ function _interopNamespace(e) {
|
|
|
26
26
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
27
27
|
Object.defineProperty(n, k, d.get ? d : {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () {
|
|
30
|
-
return e[k];
|
|
31
|
-
}
|
|
29
|
+
get: function () { return e[k]; }
|
|
32
30
|
});
|
|
33
31
|
}
|
|
34
32
|
});
|
|
35
33
|
}
|
|
36
|
-
n[
|
|
34
|
+
n["default"] = e;
|
|
37
35
|
return Object.freeze(n);
|
|
38
36
|
}
|
|
39
37
|
|
|
@@ -44,11 +42,11 @@ var _Object$assign__default = /*#__PURE__*/_interopDefault(_Object$assign);
|
|
|
44
42
|
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
45
43
|
var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
|
|
46
44
|
|
|
47
|
-
// NOTE: This string will be replaced
|
|
48
|
-
var version =
|
|
45
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
46
|
+
var version = "20.12.0";
|
|
49
47
|
|
|
50
48
|
var extractLanguageTagFromLocale = function extractLanguageTagFromLocale(locale) {
|
|
51
|
-
return _includesInstanceProperty__default[
|
|
49
|
+
return _includesInstanceProperty__default["default"](locale).call(locale, '-') ? locale.split('-')[0] : locale;
|
|
52
50
|
};
|
|
53
51
|
var mergeMessages = function mergeMessages() {
|
|
54
52
|
var _context;
|
|
@@ -57,22 +55,22 @@ var mergeMessages = function mergeMessages() {
|
|
|
57
55
|
messages[_key] = arguments[_key];
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
return _Object$assign__default[
|
|
58
|
+
return _Object$assign__default["default"].apply(Object, _concatInstanceProperty__default["default"](_context = [{}]).call(_context, messages));
|
|
61
59
|
};
|
|
62
60
|
var mapLocaleToMomentLocale = function mapLocaleToMomentLocale(locale) {
|
|
63
|
-
if (_startsWithInstanceProperty__default[
|
|
64
|
-
if (_startsWithInstanceProperty__default[
|
|
65
|
-
if (_startsWithInstanceProperty__default[
|
|
61
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'de')) return 'de';
|
|
62
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'es')) return 'es';
|
|
63
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'fr')) return 'fr';
|
|
66
64
|
if (locale === 'zh-CN') return 'zh-cn';
|
|
67
|
-
if (_startsWithInstanceProperty__default[
|
|
65
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'ja')) return 'ja';
|
|
68
66
|
return 'en-gb';
|
|
69
67
|
};
|
|
70
68
|
var mapLocaleToIntlLocale = function mapLocaleToIntlLocale(locale) {
|
|
71
|
-
if (_startsWithInstanceProperty__default[
|
|
72
|
-
if (_startsWithInstanceProperty__default[
|
|
73
|
-
if (_startsWithInstanceProperty__default[
|
|
69
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'de')) return 'de';
|
|
70
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'es')) return 'es';
|
|
71
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'fr')) return 'fr-FR';
|
|
74
72
|
if (locale === 'zh-CN') return 'zh-CN';
|
|
75
|
-
if (_startsWithInstanceProperty__default[
|
|
73
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'ja')) return 'ja';
|
|
76
74
|
return 'en';
|
|
77
75
|
};
|
|
78
76
|
|
|
@@ -185,9 +183,9 @@ var getAppKitChunkImport = function getAppKitChunkImport(locale) {
|
|
|
185
183
|
};
|
|
186
184
|
|
|
187
185
|
var getCommunityKitChunkImport = /*#__PURE__*/function () {
|
|
188
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
186
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(locale) {
|
|
189
187
|
var intlLocale;
|
|
190
|
-
return _regeneratorRuntime__default[
|
|
188
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
191
189
|
while (1) {
|
|
192
190
|
switch (_context.prev = _context.next) {
|
|
193
191
|
case 0:
|
|
@@ -270,9 +268,9 @@ function loadI18n(_x2) {
|
|
|
270
268
|
}
|
|
271
269
|
|
|
272
270
|
function _loadI18n() {
|
|
273
|
-
_loadI18n = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
271
|
+
_loadI18n = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(locale) {
|
|
274
272
|
var uiKitChunkImport, appKitChunkImport, communityKitChunkImport;
|
|
275
|
-
return _regeneratorRuntime__default[
|
|
273
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
|
|
276
274
|
while (1) {
|
|
277
275
|
switch (_context2.prev = _context2.next) {
|
|
278
276
|
case 0:
|
|
@@ -331,9 +329,9 @@ var useAsyncIntlMessages = function useAsyncIntlMessages(_ref) {
|
|
|
331
329
|
}
|
|
332
330
|
|
|
333
331
|
function _load() {
|
|
334
|
-
_load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
332
|
+
_load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(_locale) {
|
|
335
333
|
var messages;
|
|
336
|
-
return _regeneratorRuntime__default[
|
|
334
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
337
335
|
while (1) {
|
|
338
336
|
switch (_context.prev = _context.next) {
|
|
339
337
|
case 0:
|
|
@@ -400,8 +398,8 @@ var useAsyncLocaleData = function useAsyncLocaleData(_ref) {
|
|
|
400
398
|
var locale = _ref.locale,
|
|
401
399
|
applicationMessages = _ref.applicationMessages;
|
|
402
400
|
var loadApplicationMessages = react.useCallback( /*#__PURE__*/function () {
|
|
403
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
404
|
-
return _regeneratorRuntime__default[
|
|
401
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(locale) {
|
|
402
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
405
403
|
while (1) {
|
|
406
404
|
switch (_context.prev = _context.next) {
|
|
407
405
|
case 0:
|
|
@@ -470,9 +468,9 @@ var AsyncLocaleData = function AsyncLocaleData(props) {
|
|
|
470
468
|
};
|
|
471
469
|
|
|
472
470
|
AsyncLocaleData.propTypes = {
|
|
473
|
-
locale: _pt__default[
|
|
474
|
-
applicationMessages: _pt__default[
|
|
475
|
-
children: _pt__default[
|
|
471
|
+
locale: _pt__default["default"].string,
|
|
472
|
+
applicationMessages: _pt__default["default"].oneOfType([_pt__default["default"].objectOf(_pt__default["default"].oneOfType([_pt__default["default"].objectOf(_pt__default["default"].string), _pt__default["default"].objectOf(_pt__default["default"].arrayOf(_pt__default["default"].any))])), _pt__default["default"].func]).isRequired,
|
|
473
|
+
children: _pt__default["default"].func.isRequired
|
|
476
474
|
};
|
|
477
475
|
|
|
478
476
|
// Selection of shared messages, to avoid duplicating translations.
|
|
@@ -26,14 +26,12 @@ function _interopNamespace(e) {
|
|
|
26
26
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
27
27
|
Object.defineProperty(n, k, d.get ? d : {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () {
|
|
30
|
-
return e[k];
|
|
31
|
-
}
|
|
29
|
+
get: function () { return e[k]; }
|
|
32
30
|
});
|
|
33
31
|
}
|
|
34
32
|
});
|
|
35
33
|
}
|
|
36
|
-
n[
|
|
34
|
+
n["default"] = e;
|
|
37
35
|
return Object.freeze(n);
|
|
38
36
|
}
|
|
39
37
|
|
|
@@ -44,11 +42,11 @@ var _Object$assign__default = /*#__PURE__*/_interopDefault(_Object$assign);
|
|
|
44
42
|
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
45
43
|
var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
|
|
46
44
|
|
|
47
|
-
// NOTE: This string will be replaced
|
|
48
|
-
var version =
|
|
45
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
46
|
+
var version = "20.12.0";
|
|
49
47
|
|
|
50
48
|
var extractLanguageTagFromLocale = function extractLanguageTagFromLocale(locale) {
|
|
51
|
-
return _includesInstanceProperty__default[
|
|
49
|
+
return _includesInstanceProperty__default["default"](locale).call(locale, '-') ? locale.split('-')[0] : locale;
|
|
52
50
|
};
|
|
53
51
|
var mergeMessages = function mergeMessages() {
|
|
54
52
|
var _context;
|
|
@@ -57,22 +55,22 @@ var mergeMessages = function mergeMessages() {
|
|
|
57
55
|
messages[_key] = arguments[_key];
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
return _Object$assign__default[
|
|
58
|
+
return _Object$assign__default["default"].apply(Object, _concatInstanceProperty__default["default"](_context = [{}]).call(_context, messages));
|
|
61
59
|
};
|
|
62
60
|
var mapLocaleToMomentLocale = function mapLocaleToMomentLocale(locale) {
|
|
63
|
-
if (_startsWithInstanceProperty__default[
|
|
64
|
-
if (_startsWithInstanceProperty__default[
|
|
65
|
-
if (_startsWithInstanceProperty__default[
|
|
61
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'de')) return 'de';
|
|
62
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'es')) return 'es';
|
|
63
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'fr')) return 'fr';
|
|
66
64
|
if (locale === 'zh-CN') return 'zh-cn';
|
|
67
|
-
if (_startsWithInstanceProperty__default[
|
|
65
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'ja')) return 'ja';
|
|
68
66
|
return 'en-gb';
|
|
69
67
|
};
|
|
70
68
|
var mapLocaleToIntlLocale = function mapLocaleToIntlLocale(locale) {
|
|
71
|
-
if (_startsWithInstanceProperty__default[
|
|
72
|
-
if (_startsWithInstanceProperty__default[
|
|
73
|
-
if (_startsWithInstanceProperty__default[
|
|
69
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'de')) return 'de';
|
|
70
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'es')) return 'es';
|
|
71
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'fr')) return 'fr-FR';
|
|
74
72
|
if (locale === 'zh-CN') return 'zh-CN';
|
|
75
|
-
if (_startsWithInstanceProperty__default[
|
|
73
|
+
if (_startsWithInstanceProperty__default["default"](locale).call(locale, 'ja')) return 'ja';
|
|
76
74
|
return 'en';
|
|
77
75
|
};
|
|
78
76
|
|
|
@@ -185,9 +183,9 @@ var getAppKitChunkImport = function getAppKitChunkImport(locale) {
|
|
|
185
183
|
};
|
|
186
184
|
|
|
187
185
|
var getCommunityKitChunkImport = /*#__PURE__*/function () {
|
|
188
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
186
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(locale) {
|
|
189
187
|
var intlLocale;
|
|
190
|
-
return _regeneratorRuntime__default[
|
|
188
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
191
189
|
while (1) {
|
|
192
190
|
switch (_context.prev = _context.next) {
|
|
193
191
|
case 0:
|
|
@@ -270,9 +268,9 @@ function loadI18n(_x2) {
|
|
|
270
268
|
}
|
|
271
269
|
|
|
272
270
|
function _loadI18n() {
|
|
273
|
-
_loadI18n = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
271
|
+
_loadI18n = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(locale) {
|
|
274
272
|
var uiKitChunkImport, appKitChunkImport, communityKitChunkImport;
|
|
275
|
-
return _regeneratorRuntime__default[
|
|
273
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
|
|
276
274
|
while (1) {
|
|
277
275
|
switch (_context2.prev = _context2.next) {
|
|
278
276
|
case 0:
|
|
@@ -331,9 +329,9 @@ var useAsyncIntlMessages = function useAsyncIntlMessages(_ref) {
|
|
|
331
329
|
}
|
|
332
330
|
|
|
333
331
|
function _load() {
|
|
334
|
-
_load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
332
|
+
_load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(_locale) {
|
|
335
333
|
var messages;
|
|
336
|
-
return _regeneratorRuntime__default[
|
|
334
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
337
335
|
while (1) {
|
|
338
336
|
switch (_context.prev = _context.next) {
|
|
339
337
|
case 0:
|
|
@@ -400,8 +398,8 @@ var useAsyncLocaleData = function useAsyncLocaleData(_ref) {
|
|
|
400
398
|
var locale = _ref.locale,
|
|
401
399
|
applicationMessages = _ref.applicationMessages;
|
|
402
400
|
var loadApplicationMessages = react.useCallback( /*#__PURE__*/function () {
|
|
403
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
404
|
-
return _regeneratorRuntime__default[
|
|
401
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(locale) {
|
|
402
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
405
403
|
while (1) {
|
|
406
404
|
switch (_context.prev = _context.next) {
|
|
407
405
|
case 0:
|
|
@@ -470,9 +468,9 @@ var AsyncLocaleData = function AsyncLocaleData(props) {
|
|
|
470
468
|
};
|
|
471
469
|
|
|
472
470
|
AsyncLocaleData.propTypes = {
|
|
473
|
-
locale: _pt__default[
|
|
474
|
-
applicationMessages: _pt__default[
|
|
475
|
-
children: _pt__default[
|
|
471
|
+
locale: _pt__default["default"].string,
|
|
472
|
+
applicationMessages: _pt__default["default"].oneOfType([_pt__default["default"].objectOf(_pt__default["default"].oneOfType([_pt__default["default"].objectOf(_pt__default["default"].string), _pt__default["default"].objectOf(_pt__default["default"].arrayOf(_pt__default["default"].any))])), _pt__default["default"].func]).isRequired,
|
|
473
|
+
children: _pt__default["default"].func.isRequired
|
|
476
474
|
};
|
|
477
475
|
|
|
478
476
|
// Selection of shared messages, to avoid duplicating translations.
|
|
@@ -11,8 +11,8 @@ import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
|
|
|
11
11
|
import { jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
12
12
|
import { defineMessages } from 'react-intl';
|
|
13
13
|
|
|
14
|
-
// NOTE: This string will be replaced
|
|
15
|
-
var version =
|
|
14
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
15
|
+
var version = "20.12.0";
|
|
16
16
|
|
|
17
17
|
var extractLanguageTagFromLocale = function extractLanguageTagFromLocale(locale) {
|
|
18
18
|
return _includesInstanceProperty(locale).call(locale, '-') ? locale.split('-')[0] : locale;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "
|
|
1
|
+
declare const _default: "__@APPLICATION_KIT_PACKAGE/VERSION_OF_RELEASE__";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/i18n",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.12.0",
|
|
4
4
|
"description": "MC i18n messages",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"toolkit"
|
|
17
17
|
],
|
|
18
18
|
"license": "MIT",
|
|
19
|
-
"private": false,
|
|
20
19
|
"publishConfig": {
|
|
21
20
|
"access": "public"
|
|
22
21
|
},
|
|
@@ -30,29 +29,28 @@
|
|
|
30
29
|
"README.md"
|
|
31
30
|
],
|
|
32
31
|
"scripts": {
|
|
33
|
-
"
|
|
34
|
-
"prebuild": "yarn compile-data",
|
|
35
|
-
"compile-data": "formatjs compile-folder --format=$(pwd)/transifex-transformer.js --ast data compiled-data"
|
|
32
|
+
"compile-data": "formatjs compile-folder --format=./transifex-transformer.js --ast data compiled-data"
|
|
36
33
|
},
|
|
37
34
|
"dependencies": {
|
|
38
35
|
"@babel/runtime": "7.15.4",
|
|
39
36
|
"@babel/runtime-corejs3": "7.15.4",
|
|
40
37
|
"@commercetools-community-kit/i18n": "^0.2.7",
|
|
41
|
-
"@commercetools-frontend/sentry": "20.
|
|
38
|
+
"@commercetools-frontend/sentry": "20.12.0",
|
|
42
39
|
"@commercetools-uikit/i18n": "^12.0.7",
|
|
43
|
-
"@emotion/react": "11.
|
|
44
|
-
"@formatjs/icu-messageformat-parser": "2.0.
|
|
40
|
+
"@emotion/react": "11.5.0",
|
|
41
|
+
"@formatjs/icu-messageformat-parser": "2.0.14",
|
|
45
42
|
"@types/prop-types": "^15.7.3",
|
|
46
43
|
"@types/react": "^17.0.16",
|
|
47
44
|
"moment": "^2.29.1",
|
|
48
45
|
"prop-types": "15.7.2"
|
|
49
46
|
},
|
|
50
47
|
"devDependencies": {
|
|
48
|
+
"@formatjs/cli": "4.4.0",
|
|
51
49
|
"react": "17.0.2",
|
|
52
|
-
"react-intl": "5.
|
|
50
|
+
"react-intl": "5.21.0"
|
|
53
51
|
},
|
|
54
52
|
"peerDependencies": {
|
|
55
53
|
"react": "17.x",
|
|
56
54
|
"react-intl": "5.x"
|
|
57
55
|
}
|
|
58
|
-
}
|
|
56
|
+
}
|