@bottlebooks/valid-values 1.1.0 → 1.2.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.
Files changed (93) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/core/translate.d.ts +3 -0
  3. package/dist/core/translate.d.ts.map +1 -0
  4. package/dist/core/translate.js +42 -0
  5. package/dist/index.d.ts +1 -2
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +9 -10
  8. package/dist/main.js +23 -17
  9. package/dist/validValues/award.d.ts +6 -2
  10. package/dist/validValues/award.d.ts.map +1 -1
  11. package/dist/validValues/award.js +29 -236
  12. package/dist/validValues/awardMedal.d.ts +1 -1
  13. package/dist/validValues/beerStyle.d.ts +1 -1
  14. package/dist/validValues/certification.d.ts +1 -1
  15. package/dist/validValues/country.d.ts +7 -2
  16. package/dist/validValues/country.d.ts.map +1 -1
  17. package/dist/validValues/country.js +2 -149
  18. package/dist/validValues/designation.d.ts +0 -115
  19. package/dist/validValues/designation.d.ts.map +1 -1
  20. package/dist/validValues/ingredient.d.ts +1 -1
  21. package/dist/validValues/ingredient.d.ts.map +1 -1
  22. package/dist/validValues/ingredient.js +37 -33
  23. package/dist/validValues/packagingCertification.d.ts +1 -1
  24. package/dist/validValues/productType.d.ts +6 -2
  25. package/dist/validValues/productType.d.ts.map +1 -1
  26. package/dist/validValues/productType.js +39 -78
  27. package/dist/validValues/productionMethod.d.ts +1 -1
  28. package/dist/validValues/region.d.ts +14 -17
  29. package/dist/validValues/region.d.ts.map +1 -1
  30. package/dist/validValues/region.js +4804 -5250
  31. package/dist/validValues/responsibleConsumptionLogo.d.ts +1 -1
  32. package/dist/validValues/subregion.d.ts +10 -17
  33. package/dist/validValues/subregion.d.ts.map +1 -1
  34. package/dist/validValues/subregion.js +11115 -13852
  35. package/dist/validValues/types/ProductType.d.ts.map +1 -1
  36. package/dist/validValues/types/ValidValueDefinition.d.ts +1 -1
  37. package/dist/validValues/types/ValidValueDefinition.d.ts.map +1 -1
  38. package/dist/validValues/types/award_p85_100.d.ts +3 -0
  39. package/dist/validValues/types/award_p85_100.d.ts.map +1 -0
  40. package/dist/validValues/types/award_p85_100.js +9 -0
  41. package/dist/validValues/types/productTypesSpirit.d.ts +4 -0
  42. package/dist/validValues/types/productTypesSpirit.d.ts.map +1 -0
  43. package/dist/validValues/types/productTypesSpirit.js +9 -0
  44. package/dist/validValues/types/productTypesWine.d.ts +4 -0
  45. package/dist/validValues/types/productTypesWine.d.ts.map +1 -0
  46. package/dist/validValues/types/productTypesWine.js +9 -0
  47. package/dist/validValues/utils/createValidValues.d.ts +1 -1
  48. package/dist/validValues/utils/createValidValues.d.ts.map +1 -1
  49. package/dist/validValues/utils/createValidValues.js +50 -53
  50. package/dist/validValues/varietyName.d.ts +1 -1
  51. package/dist/validValues/wineColor.d.ts +1 -1
  52. package/dist/validValues/wineType.d.ts +1 -1
  53. package/package.json +2 -2
  54. package/region.ts +0 -0
  55. package/src/core/translate.ts +40 -0
  56. package/src/index.ts +1 -6
  57. package/src/locales/po/bg.po +2110 -2110
  58. package/src/locales/po/de.po +2110 -2110
  59. package/src/locales/po/ee.po +2110 -2110
  60. package/src/locales/po/en.po +2110 -2110
  61. package/src/locales/po/es.po +2110 -2110
  62. package/src/locales/po/fi.po +2110 -2110
  63. package/src/locales/po/fr.po +2110 -2110
  64. package/src/locales/po/hr.po +2110 -2110
  65. package/src/locales/po/hu.po +2110 -2110
  66. package/src/locales/po/it.po +2110 -2110
  67. package/src/locales/po/lt.po +2110 -2110
  68. package/src/locales/po/lv.po +2110 -2110
  69. package/src/locales/po/mt.po +2110 -2110
  70. package/src/locales/po/nl.po +2110 -2110
  71. package/src/locales/po/pl.po +2110 -2110
  72. package/src/locales/po/pt.po +2110 -2110
  73. package/src/locales/po/ro.po +2110 -2110
  74. package/src/locales/po/se.po +2110 -2110
  75. package/src/locales/po/si.po +2110 -2110
  76. package/src/locales/po/sk.po +2110 -2110
  77. package/src/main.ts +39 -29
  78. package/src/validValues/award.ts +242 -709
  79. package/src/validValues/country.ts +7 -148
  80. package/src/validValues/designation.ts +0 -5
  81. package/src/validValues/ingredient.ts +35 -343
  82. package/src/validValues/productType.ts +7 -40
  83. package/src/validValues/region.ts +514 -479
  84. package/src/validValues/subregion.ts +1429 -2775
  85. package/src/validValues/types/ProductType.ts +0 -1
  86. package/src/validValues/types/ValidValueDefinition.ts +1 -1
  87. package/src/validValues/types/award_p85_100.ts +19 -0
  88. package/src/validValues/types/productTypesSpirit.ts +38 -0
  89. package/src/validValues/types/productTypesWine.ts +10 -0
  90. package/src/validValues/utils/createValidValues.ts +52 -50
  91. package/dist/validValues/types/Country.js +0 -5
  92. package/src/validValues/types/Award.ts +0 -39
  93. package/src/validValues/types/Country.ts +0 -39
@@ -1 +1 @@
1
- {"version":3,"file":"ProductType.d.ts","sourceRoot":"","sources":["../../../src/validValues/types/ProductType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,MAAM,WAAW,WAAY,SAAQ,oBAAoB;IACvD,KAAK,EAAE,iBAAiB,CAAC;CAC1B"}
1
+ {"version":3,"file":"ProductType.d.ts","sourceRoot":"","sources":["../../../src/validValues/types/ProductType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,WAAW,WAAY,SAAQ,oBAAoB;IACvD,KAAK,EAAE,iBAAiB,CAAC;CAC1B"}
@@ -11,7 +11,7 @@ export interface ValidValueDefinition {
11
11
  *
12
12
  * Define it using `defineMessage()` from @lingui/macro.
13
13
  */
14
- title?: string | MessageDescriptor;
14
+ title: string | MessageDescriptor;
15
15
  /**
16
16
  * Fields that will never be stored in the database,
17
17
  * because they are not relevant to the frontend rendering.
@@ -1 +1 @@
1
- {"version":3,"file":"ValidValueDefinition.d.ts","sourceRoot":"","sources":["../../../src/validValues/types/ValidValueDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,UAAU,oBAAoB;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACpC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAAC;IACnC;;;;OAIG;IACH,IAAI,CAAC,EAAE,EAKN,CAAC;IACF;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,EAAE,CAAC;CACf"}
1
+ {"version":3,"file":"ValidValueDefinition.d.ts","sourceRoot":"","sources":["../../../src/validValues/types/ValidValueDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,UAAU,oBAAoB;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACpC;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAAC;IAClC;;;;OAIG;IACH,IAAI,CAAC,EAAE,EAKN,CAAC;IACF;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,EAAE,CAAC;CACf"}
@@ -0,0 +1,3 @@
1
+ declare const range: Array<string>;
2
+ export default range;
3
+ //# sourceMappingURL=award_p85_100.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"award_p85_100.d.ts","sourceRoot":"","sources":["../../../src/validValues/types/award_p85_100.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,MAAM,CAiBxB,CAAC;AACF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var range = ['p_85', 'p_86', 'p_87', 'p_88', 'p_89', 'p_90', 'p_91', 'p_92', 'p_93', 'p_94', 'p_95', 'p_96', 'p_97', 'p_98', 'p_99', 'p_100'];
8
+ var _default = range;
9
+ exports["default"] = _default;
@@ -0,0 +1,4 @@
1
+ import { ProductType } from './ProductTypeKey';
2
+ declare const PRODUCT_TYPE_SPIRITS: Array<ProductType>;
3
+ export default PRODUCT_TYPE_SPIRITS;
4
+ //# sourceMappingURL=productTypesSpirit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"productTypesSpirit.d.ts","sourceRoot":"","sources":["../../../src/validValues/types/productTypesSpirit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,WAAW,CAkC5C,CAAC;AACF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var PRODUCT_TYPE_SPIRITS = ['spirit_absinthe', 'spirit_anise', 'spirit_aquavit', 'spirit_arak', 'spirit_armagnac', 'spirit_asianspirit', 'spirit_bitter', 'spirit_cachaca', 'spirit_calvados', 'spirit_cocktail', 'spirit_cognac', 'spirit_fruitspirit', 'spirit_genever', 'spirit_gin', 'spirit_grainspirit', 'spirit_grapebrandy', 'spirit_grappa', 'spirit_liqueur', 'spirit_marc', 'spirit_mezcal', 'spirit_miscspririt', 'spirit_ouzo', 'spirit_pastis', 'spirit_pisco', 'spirit_raki', 'spirit_rum', 'spirit_sambuca', 'spirit_shochu', 'spirit_schnaps', 'spirit_tequila', 'spirit_vermouth', 'spirit_vodka', 'spirit_whisky'];
8
+ var _default = PRODUCT_TYPE_SPIRITS;
9
+ exports["default"] = _default;
@@ -0,0 +1,4 @@
1
+ import { ProductType } from './ProductTypeKey';
2
+ declare const PRODUCT_TYPE_WINES: Array<ProductType>;
3
+ export default PRODUCT_TYPE_WINES;
4
+ //# sourceMappingURL=productTypesWine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"productTypesWine.d.ts","sourceRoot":"","sources":["../../../src/validValues/types/productTypesWine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,WAAW,CAM1C,CAAC;AACF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var PRODUCT_TYPE_WINES = ['wine_stillwine', 'wine_fortified', 'wine_pearlwine', 'wine_sparkling', 'wine_aromatized'];
8
+ var _default = PRODUCT_TYPE_WINES;
9
+ exports["default"] = _default;
@@ -2,7 +2,7 @@ import { allMessages } from '../../locales/locales.js';
2
2
  import { ValidValueDefinition } from '../types/ValidValueDefinition';
3
3
  declare type Locale = keyof typeof allMessages;
4
4
  export default function createValidValues<ValidValue extends ValidValueDefinition = ValidValueDefinition>(values: Record<string, ValidValue>): {
5
- list: () => ({
5
+ list: ({
6
6
  /** The value identifier. */
7
7
  id: string;
8
8
  } & ValidValue & {
@@ -1 +1 @@
1
- {"version":3,"file":"createValidValues.d.ts","sourceRoot":"","sources":["../../../src/validValues/utils/createValidValues.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAKrE,aAAK,MAAM,GAAG,MAAM,OAAO,WAAW,CAAC;AAEvC,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,UAAU,SAAS,oBAAoB,GAAG,oBAAoB,EAC9D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;;QA0B5B,4BAA4B;;;QAG5B,qDAAqD;4BArB5B,MAAM;QAuB/B,0DAA0D;4BACvC,MAAM,EAAE;;;;;YAN3B,4BAA4B;;;YAG5B,qDAAqD;gCArB5B,MAAM;YAuB/B,0DAA0D;gCACvC,MAAM,EAAE;;;;EA4BlC"}
1
+ {"version":3,"file":"createValidValues.d.ts","sourceRoot":"","sources":["../../../src/validValues/utils/createValidValues.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAKrE,aAAK,MAAM,GAAG,MAAM,OAAO,WAAW,CAAC;AAEvC,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,UAAU,SAAS,oBAAoB,GAAG,oBAAoB,EAC9D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;;QA4B9B,4BAA4B;;;QAG5B,qDAAqD;4BAxB5B,MAAM;QA0B/B,0DAA0D;4BACvC,MAAM,EAAE;;;;;YAN3B,4BAA4B;;;YAG5B,qDAAqD;gCAxB5B,MAAM;YA0B/B,0DAA0D;gCACvC,MAAM,EAAE;;;;EA4BhC"}
@@ -34,66 +34,63 @@ _core.i18n.loadLocaleData(_locales.allLocaleData);
34
34
  _core.i18n.load(_locales.allMessages);
35
35
 
36
36
  function createValidValues(values) {
37
- function list() {
38
- // TODO if we provide locale argument here we can avoid getTitle without locale argument which can help in .map functions
39
- // const initialLocale = locale;
40
- return Object.entries(values).map(function (_ref) {
41
- var _ref2 = _slicedToArray(_ref, 2),
42
- id = _ref2[0],
43
- value = _ref2[1];
44
-
45
- var key = value.key,
46
- title = value.title,
47
- form = value.form,
48
- frontend = value.frontend;
49
- if (!title) throw new Error('missing_required:title');
50
-
51
- function getTitle(locale) {
52
- if (typeof title === 'string') {
53
- return title;
54
- } else if (title) {
55
- _core.i18n.activate(locale || 'en');
56
-
57
- var translation = _core.i18n._(title) || '';
58
-
59
- if (translation === title.id) {
60
- console.log('%c' + "WARNING: translation_missing:".concat(title.id, ":").concat(locale), 'color: #d0011b;');
61
-
62
- _core.i18n.activate('en');
63
-
64
- return _core.i18n._(title) || '';
65
- }
66
-
67
- return translation;
68
- } else {
69
- return key;
37
+ // TODO if we provide locale argument here we can avoid getTitle without locale argument which can help in .map functions
38
+ // const initialLocale = locale;
39
+ var list = Object.entries(values).map(function (_ref) {
40
+ var _ref2 = _slicedToArray(_ref, 2),
41
+ id = _ref2[0],
42
+ value = _ref2[1];
43
+
44
+ var key = value.key,
45
+ title = value.title,
46
+ form = value.form,
47
+ frontend = value.frontend;
48
+ if (!title) throw new Error('missing_required:title');
49
+
50
+ function getTitle(locale) {
51
+ if (typeof title === 'string') {
52
+ return title;
53
+ } else if (title) {
54
+ _core.i18n.activate(locale || 'en');
55
+
56
+ var translation = _core.i18n._(title) || '';
57
+
58
+ if (translation === title.id) {
59
+ console.log('%c' + "WARNING: translation_missing:".concat(title.id, ":").concat(locale), 'color: #d0011b;');
60
+
61
+ _core.i18n.activate('en');
62
+
63
+ return _core.i18n._(title) || '';
70
64
  }
65
+
66
+ return translation;
67
+ } else {
68
+ return key;
71
69
  }
70
+ }
72
71
 
73
- return _objectSpread(_objectSpread({
74
- /** The value identifier. */
75
- id: id
76
- }, value), {}, {
77
- /** Returns the localized title of a lookup value. */
78
- getTitle: getTitle,
79
-
80
- /** Returns the translatet titles for multiple locales. */
81
- getTitles: function getTitles() {
82
- var locales = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : allSupportedLocales;
83
- var translations = Object.fromEntries(locales.map(function (locale) {
84
- return [locale, getTitle(locale)];
85
- }));
86
- return translations;
87
- },
88
- form: value.form ? _objectSpread({}, value.form) : undefined
89
- });
72
+ return _objectSpread(_objectSpread({
73
+ /** The value identifier. */
74
+ id: id
75
+ }, value), {}, {
76
+ /** Returns the localized title of a lookup value. */
77
+ getTitle: getTitle,
78
+
79
+ /** Returns the translatet titles for multiple locales. */
80
+ getTitles: function getTitles() {
81
+ var locales = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : allSupportedLocales;
82
+ var translations = Object.fromEntries(locales.map(function (locale) {
83
+ return [locale, getTitle(locale)];
84
+ }));
85
+ return translations;
86
+ },
87
+ form: value.form ? _objectSpread({}, value.form) : undefined
90
88
  });
91
- }
92
-
89
+ });
93
90
  return {
94
91
  list: list,
95
92
  byId: function byId() {
96
- return Object.fromEntries(list().map(function (value) {
93
+ return Object.fromEntries(list.map(function (value) {
97
94
  return [value.id, value];
98
95
  }));
99
96
  }
@@ -2,7 +2,7 @@ import { ValidValueDefinition } from './types/ValidValueDefinition';
2
2
  export interface VarietyName extends ValidValueDefinition {
3
3
  }
4
4
  declare const _default: {
5
- list: () => ({
5
+ list: ({
6
6
  id: string;
7
7
  } & VarietyName & {
8
8
  getTitle: (locale?: "de" | "en" | "es" | "fr" | "it" | "pt" | "sk" | "bg" | "hr" | "nl" | "ee" | "fi" | "hu" | "lv" | "lt" | "mt" | "pl" | "ro" | "si" | "se" | undefined) => string;
@@ -2,7 +2,7 @@ import { ValidValueDefinition } from './types/ValidValueDefinition';
2
2
  export interface WineColor extends ValidValueDefinition {
3
3
  }
4
4
  declare const _default: {
5
- list: () => ({
5
+ list: ({
6
6
  id: string;
7
7
  } & WineColor & {
8
8
  getTitle: (locale?: "de" | "en" | "es" | "fr" | "it" | "pt" | "sk" | "bg" | "hr" | "nl" | "ee" | "fi" | "hu" | "lv" | "lt" | "mt" | "pl" | "ro" | "si" | "se" | undefined) => string;
@@ -2,7 +2,7 @@ import { ValidValueDefinition } from './types/ValidValueDefinition';
2
2
  export interface WineType extends ValidValueDefinition {
3
3
  }
4
4
  declare const _default: {
5
- list: () => ({
5
+ list: ({
6
6
  id: string;
7
7
  } & WineType & {
8
8
  getTitle: (locale?: "de" | "en" | "es" | "fr" | "it" | "pt" | "sk" | "bg" | "hr" | "nl" | "ee" | "fi" | "hu" | "lv" | "lt" | "mt" | "pl" | "ro" | "si" | "se" | undefined) => string;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@bottlebooks/valid-values",
3
3
  "description": "The Bottlebooks lookup values, defined globally.",
4
4
  "private": false,
5
- "version": "1.1.0",
5
+ "version": "1.2.1",
6
6
  "type": "commonjs",
7
7
  "main": "dist/index.js",
8
8
  "scripts": {
@@ -32,5 +32,5 @@
32
32
  "@babel/core": "^7.15.5",
33
33
  "@lingui/core": "^3.14.0"
34
34
  },
35
- "gitHead": "9ab06a18f85e53955536c3e65ff53381ec1df03f"
35
+ "gitHead": "fc6e66bcc86624d21020629f89b961862bbb7f4f"
36
36
  }
package/region.ts ADDED
File without changes
@@ -0,0 +1,40 @@
1
+ import { i18n, MessageDescriptor } from '@lingui/core';
2
+
3
+ export function translate(title: MessageDescriptor | string, locale?: string) {
4
+ // if (typeof title === 'string') {
5
+ // return title;
6
+ // }
7
+ const messageId = typeof title === 'string' ? title : title?.id;
8
+ if (!messageId) {
9
+ console.log(
10
+ '%c' + `ERROR: messageId_missing:${JSON.stringify(title)}`,
11
+ 'color: #d0011b;'
12
+ );
13
+ return '';
14
+ }
15
+
16
+ if (!locale) {
17
+ locale = 'en';
18
+ }
19
+ // else {
20
+ // i18n.activate('en');
21
+ // }
22
+ i18n.activate(locale);
23
+
24
+ let translation = i18n._(messageId);
25
+ if (translation === messageId) {
26
+ if (messageId.includes('validValues.')) {
27
+ console.log(
28
+ '%c' + `ERROR: translation_missing:${messageId}:${locale}`,
29
+ 'color: #d0011b;'
30
+ );
31
+ return '';
32
+ }
33
+ console.log(
34
+ '%c' + `WARNING: translation==messageId:${messageId}:${locale}`,
35
+ 'color: #d0011b;'
36
+ );
37
+ }
38
+
39
+ return translation;
40
+ }
package/src/index.ts CHANGED
@@ -1,10 +1,5 @@
1
1
  import { i18n, MessageDescriptor } from '@lingui/core';
2
2
  import { allLocaleData } from './locales/locales.js';
3
-
3
+ export { translate } from './core/translate';
4
4
  export * from './validValues';
5
5
  export const allSupportedLocales = Object.keys(allLocaleData);
6
-
7
- export function translate(message: MessageDescriptor, locale: string) {
8
- i18n.activate(locale);
9
- return i18n._(message);
10
- }