lecom-ui 3.9.8 → 4.0.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.
@@ -19,22 +19,36 @@ const i18nConfig = {
19
19
  escapeValue: false
20
20
  }
21
21
  };
22
- console.log("i18n.isInitialized 0");
23
22
  if (!i18n.isInitialized) {
24
- console.log("i18n.isInitialized 1");
25
23
  i18n.use(initReactI18next).init(i18nConfig);
26
24
  }
27
25
  const initializeI18n = ({
28
26
  resources,
29
27
  lng = "pt_BR" /* PT_BR */
30
28
  }) => {
31
- let mappedResources = {};
32
- if (resources) {
33
- mappedResources = {
34
- ...i18nConfig.resources,
35
- resources
36
- };
37
- }
29
+ const mappedResources = {
30
+ resources: {
31
+ ["pt_BR" /* PT_BR */]: {
32
+ translations: {
33
+ ...translations["pt_BR" /* PT_BR */].translations,
34
+ ...resources?.["pt_BR" /* PT_BR */]?.translations ?? {}
35
+ }
36
+ },
37
+ ["en_US" /* EN_US */]: {
38
+ translations: {
39
+ ...translations["en_US" /* EN_US */].translations,
40
+ ...resources?.["en_US" /* EN_US */]?.translations ?? {}
41
+ }
42
+ },
43
+ ["es_ES" /* ES_ES */]: {
44
+ translations: {
45
+ ...translations["es_ES" /* ES_ES */].translations,
46
+ ...resources?.["es_ES" /* ES_ES */]?.translations ?? {}
47
+ }
48
+ }
49
+ }
50
+ };
51
+ console.log(i18nConfig, mappedResources, resources);
38
52
  i18n.use(initReactI18next).init({ ...i18nConfig, ...mappedResources, lng });
39
53
  };
40
54
 
package/dist/index.d.ts CHANGED
@@ -276,7 +276,9 @@ declare enum Translations {
276
276
  ES_ES = "es_ES"
277
277
  }
278
278
  interface InitializeI18n {
279
- resources?: InitOptions['resources'];
279
+ resources?: {
280
+ [key in Translations]: InitOptions['resources'];
281
+ };
280
282
  lng?: Translations;
281
283
  }
282
284
  declare const initializeI18n: ({ resources, lng, }: InitializeI18n) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "3.9.8",
3
+ "version": "4.0.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",