@everymatrix/player-account-self-exclusion 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/player-account-self-exclusion",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "main": "dist/player-account-self-exclusion",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "4b2bbc7cb2c3424950a39147a985ac5d38207cdf"
40
+ "gitHead": "5da9a4e3b1b2d635a921ce3981f56157191f5aa7"
41
41
  }
@@ -11,6 +11,7 @@
11
11
 
12
12
  export let lang:string = 'en';
13
13
  export let operator:string = 'Everymatrix';
14
+ export let translationUrl:string = '';
14
15
 
15
16
  let userAgent:string = window.navigator.userAgent;
16
17
  let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
@@ -24,6 +25,19 @@
24
25
  let minDate:string;
25
26
  let maxDate:string;
26
27
 
28
+ const setTranslationUrl = ():void => {
29
+ let url:string = translationUrl;
30
+
31
+ fetch(url).then((res:any) => res.json())
32
+ .then((res) => {
33
+ Object.keys(res).forEach((item:any):void => {
34
+ addNewMessages(item, res[item]);
35
+ });
36
+ }).catch((err:any) => {
37
+ console.log(err);
38
+ });
39
+ }
40
+
27
41
  Object.keys(PlayerSelfExclusionTranslations).forEach((item:any) => {
28
42
  addNewMessages(item, PlayerSelfExclusionTranslations[item]);
29
43
  });
@@ -91,6 +105,7 @@
91
105
 
92
106
  $: calendar && setCalendarEventListener();
93
107
  $: lang && initialLoad();
108
+ $: translationUrl && setTranslationUrl();
94
109
  </script>
95
110
 
96
111
  <form class="SelfExclusionWrapper {isMobile ? 'SelfExclusionWrapperMobile' : ''}" part="SelfExclusionWrapper {isMobile ? 'SelfExclusionWrapperMobile' : ''}">