@shopgate/engage 7.31.4-beta.1 → 7.31.5-beta.1

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.
@@ -40,6 +40,10 @@ export type I18nHelpers = {
40
40
  * - Get locale data by path
41
41
  */
42
42
  getPath: Function;
43
+ /**
44
+ * - Check whether a translation key resolves to a value
45
+ */
46
+ has: Function;
43
47
  /**
44
48
  * - Get locale lang code, eg de-DE
45
49
  */
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../core/helpers/i18n.js"],"names":[],"mappings":"AAyEA;;GAEG;AACH,mBAFU,WAAW,CAEM;AAMpB,oCAFM,MAAM,EAAE,CAQpB"}
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../core/helpers/i18n.js"],"names":[],"mappings":"AA4EA;;GAEG;AACH,mBAFU,WAAW,CAEM;AAMpB,oCAFM,MAAM,EAAE,CAQpB"}
@@ -13,6 +13,7 @@ import { logger } from '@shopgate/pwa-core/helpers';
13
13
  * @property {Function} number - Number translator
14
14
  * @property {Function} getSupplementalData - Get Supplemental Data
15
15
  * @property {Function} getPath - Get locale data by path
16
+ * @property {Function} has - Check whether a translation key resolves to a value
16
17
  * @property {Function} getLang - Get locale lang code, eg de-DE
17
18
  */
18
19
 
@@ -50,6 +51,7 @@ const I18n = () => {
50
51
  this.number = getNumberFormatter(lang);
51
52
  this.getSupplementalData = () => locales.supplementalData || {};
52
53
  this.getPath = path => get(locales, path);
54
+ this.has = path => this.getPath(path) !== undefined;
53
55
  this.getLang = () => lang;
54
56
  // If component decides to act accordingly this information should be exposed.
55
57
  this.ready = true;
@@ -62,6 +64,7 @@ const I18n = () => {
62
64
  number: notReadyCb,
63
65
  getSupplementalData: notReadyCb,
64
66
  getPath: notReadyCb,
67
+ has: notReadyCb,
65
68
  getLang: notReadyCb,
66
69
  ready: false
67
70
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/engage",
3
- "version": "7.31.4-beta.1",
3
+ "version": "7.31.5-beta.1",
4
4
  "description": "Shopgate's ENGAGE library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -18,12 +18,12 @@
18
18
  "dependencies": {
19
19
  "@emotion/react": "^11.14.0",
20
20
  "@shopgate/native-modules": "1.0.0-beta.32",
21
- "@shopgate/pwa-common": "7.31.4-beta.1",
22
- "@shopgate/pwa-common-commerce": "7.31.4-beta.1",
23
- "@shopgate/pwa-core": "7.31.4-beta.1",
24
- "@shopgate/pwa-ui-ios": "7.31.4-beta.1",
25
- "@shopgate/pwa-ui-material": "7.31.4-beta.1",
26
- "@shopgate/pwa-ui-shared": "7.31.4-beta.1",
21
+ "@shopgate/pwa-common": "7.31.5-beta.1",
22
+ "@shopgate/pwa-common-commerce": "7.31.5-beta.1",
23
+ "@shopgate/pwa-core": "7.31.5-beta.1",
24
+ "@shopgate/pwa-ui-ios": "7.31.5-beta.1",
25
+ "@shopgate/pwa-ui-material": "7.31.5-beta.1",
26
+ "@shopgate/pwa-ui-shared": "7.31.5-beta.1",
27
27
  "@stripe/react-stripe-js": "^1.16.5",
28
28
  "@stripe/stripe-js": "^1.44.1",
29
29
  "@virtuous/conductor": "~2.5.0",