@omniumretail/component-library 0.1.16 → 0.1.18

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.
@@ -4,19 +4,29 @@ import { initReactI18next } from "react-i18next";
4
4
  import en from '../locales/en.json';
5
5
  import es from '../locales/es.json';
6
6
  import pt from '../locales/pt.json';
7
+ var merge = require('lodash.merge');
7
8
 
8
- i18next
9
+ export const mergei18n = (appResources: any) => {
10
+ debugger;
11
+ console.log(appResources, merge({
12
+ en: { translation: en },
13
+ pt: { translation: pt },
14
+ es: { translation: es },
15
+ }, appResources));
16
+
17
+ i18next
9
18
  .use(initReactI18next)
10
19
  .use(LanguageDetector)
11
20
  .init({
12
- resources: {
21
+ resources: merge({
13
22
  en: { translation: en },
14
23
  pt: { translation: pt },
15
24
  es: { translation: es },
16
- },
25
+ }, appResources),
17
26
  detection: {
18
27
  order: ['querystring', 'navigator', 'htmlTag'],
19
28
  lookupQuerystring: 'lng',
20
29
  htmlTag: document.documentElement,
21
30
  },
22
31
  });
32
+ }
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './components';
2
+ export * from './constants/i18n';
@@ -11,5 +11,9 @@
11
11
  "back": "Go Back",
12
12
  "logout": "Log Out",
13
13
  "home": "Home"
14
+ },
15
+ "actions": {
16
+ "one": "one",
17
+ "two": "two"
14
18
  }
15
19
  }
@@ -11,5 +11,9 @@
11
11
  "back": "Go Back ES",
12
12
  "logout": "Log Out ES",
13
13
  "home": "Home ES"
14
+ },
15
+ "actions": {
16
+ "one": "one ES",
17
+ "two": "two ES"
14
18
  }
15
19
  }
@@ -11,5 +11,9 @@
11
11
  "back": "Go Back PT",
12
12
  "logout": "Log Out PT",
13
13
  "home": "Home PT"
14
+ },
15
+ "actions": {
16
+ "one": "one PT",
17
+ "two": "two PT"
14
18
  }
15
19
  }
package/webpack.config.js CHANGED
@@ -45,5 +45,6 @@ module.exports = {
45
45
  react: "react",
46
46
  "react-dom": "react-dom",
47
47
  "react-router-dom": "react-router-dom",
48
+ "react-i18next": "react-i18next",
48
49
  },
49
50
  };