@everymatrix/casino-hamburger-menu 1.0.13 → 1.0.14

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-hamburger-menu",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "main": "dist/casino-hamburger-menu.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "4b2bbc7cb2c3424950a39147a985ac5d38207cdf"
39
+ "gitHead": "5da9a4e3b1b2d635a921ce3981f56157191f5aa7"
40
40
  }
@@ -11,6 +11,7 @@
11
11
  export let lang:string = 'en';
12
12
  export let activecategory:string = '';
13
13
  export let languageslist:string = '';
14
+ export let translationUrl:string = '';
14
15
  export let clientstyling:string = '';
15
16
  export let clientstylingurl:string = '';
16
17
 
@@ -35,6 +36,19 @@
35
36
 
36
37
  // setupI18n({ withLocale: 'en', translations: {}});
37
38
 
39
+ const setTranslationUrl = ():void => {
40
+ let url:string = translationUrl;
41
+
42
+ fetch(url).then((res:any) => res.json())
43
+ .then((res) => {
44
+ Object.keys(res).forEach((item:any):void => {
45
+ addNewMessages(item, res[item]);
46
+ });
47
+ }).catch((err:any) => {
48
+ console.log(err);
49
+ });
50
+ }
51
+
38
52
  Object.keys(CasinoHamburgerMenu).forEach((item:any) => {
39
53
  addNewMessages(item, CasinoHamburgerMenu[item]);
40
54
  });
@@ -165,6 +179,7 @@
165
179
 
166
180
  $: lang && languageslist && initialLoad();
167
181
  $: activecategory && !isLoading && setActiveIndex();
182
+ $: translationUrl && setTranslationUrl();
168
183
  $: clientstyling && customStylingContainer && setClientStyling();
169
184
  $: clientstylingurl && customStylingContainer && setClientStylingURL();
170
185
  </script>