lecom-ui 3.9.9 → 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.
@@ -26,13 +26,28 @@ const initializeI18n = ({
26
26
  resources,
27
27
  lng = "pt_BR" /* PT_BR */
28
28
  }) => {
29
- let mappedResources = {};
30
- if (resources) {
31
- mappedResources = {
32
- ...i18nConfig.resources,
33
- resources
34
- };
35
- }
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
+ };
36
51
  console.log(i18nConfig, mappedResources, resources);
37
52
  i18n.use(initReactI18next).init({ ...i18nConfig, ...mappedResources, lng });
38
53
  };
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.9",
3
+ "version": "4.0.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",