@everymatrix/player-account-timeout 0.0.197 → 0.0.201

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-timeout",
3
- "version": "0.0.197",
3
+ "version": "0.0.201",
4
4
  "main": "dist/player-account-timeout.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": "89d693d3429e3dc0d6e642537452c8faa0ca008a"
39
+ "gitHead": "71051531499cfea745b53a0f7c0a77a252990ae7"
40
40
  }
@@ -2,15 +2,23 @@
2
2
  <script lang="typescript">
3
3
 
4
4
  import { getDevice } from 'rvhelper';
5
+ import { _, addNewMessages, setLocale } from './i18n';
6
+ import { PlayerTimeoutTranslations } from './translations';
7
+
8
+ export let lang:string = 'en';
5
9
 
6
10
  let userAgent:String = window.navigator.userAgent;
7
11
  let isMobile = (getDevice(userAgent) === 'PC') ? false : true;
8
12
 
13
+ Object.keys(PlayerTimeoutTranslations).forEach((item:any) => {
14
+ addNewMessages(item, PlayerTimeoutTranslations[item]);
15
+ });
16
+
9
17
  let timeoutOptions:Array<Object> = [
10
- { value: 'CoolOffFor24Hours', text: '24 hours' },
11
- { value: 'CoolOffFor7Days', text: '7 days' },
12
- { value: 'CoolOffFor30Days', text: '30 days' },
13
- { value: 'CoolOffFor3Months', text: '3 months' }
18
+ { value: $_('timeout.cooloff24'), text: $_('timeout.cooloff24Text') },
19
+ { value: $_('timeout.cooloff7'), text: $_('timeout.cooloff7Text') },
20
+ { value: $_('timeout.cooloff30'), text: $_('timeout.cooloff30Text') },
21
+ { value: $_('timeout.cooloff3'), text: $_('timeout.cooloff3Text') }
14
22
  ];
15
23
  let timeoutSelected:string = timeoutOptions[0].value;
16
24
 
@@ -21,6 +29,12 @@
21
29
  const toggleScreen = () => {
22
30
  window.postMessage({ type: 'ReturnToMenu' }, window.location.href);
23
31
  }
32
+
33
+ const initialLoad = () => {
34
+ setLocale(lang);
35
+ }
36
+
37
+ $: lang && initialLoad();
24
38
  </script>
25
39
 
26
40
  <div class="TimeoutWrapper {isMobile ? 'TimeoutWrapperMobile' : ''}">
@@ -31,13 +45,13 @@
31
45
  <path class="aaa" d="M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z" transform="translate(15 15) rotate(180)"/>
32
46
  </g></g>
33
47
  </svg>
34
- <h2 class="TimeoutTitleMobile">Timeout</h2>
48
+ <h2 class="TimeoutTitleMobile">{$_('timeout.title')}</h2>
35
49
  </div>
36
50
  {/if}
37
- <h2 class="TimeoutTitle {isMobile ? 'TimeoutTitleNone' : ''}">Timeout</h2>
51
+ <h2 class="TimeoutTitle {isMobile ? 'TimeoutTitleNone' : ''}">{$_('timeout.title')}</h2>
38
52
  <div class="TimeoutDescription {isMobile ? 'TimeoutDescriptionMobile' : ''}">
39
- <p>Everymatrix provides you an easy way to take a break from the games. You can request automatic blocking of your account for 24 hours. During the temporary restraint, you will not be able to access your Account.</p>
40
- <p>Please note that the “Time-out facility” does not in any case replace “Self-exclusion”. If you think you are experiencing a gambling addiction problem, please enter the link under "Responsible Gaming" and use the "Self-exclusion service" or contact us as soon as possible.</p>
53
+ <p>{$_('timeout.timeoutTextFirst')}</p>
54
+ <p>{$_('timeout.timeoutTextSecondary')}</p>
41
55
  </div>
42
56
  <div class="TimeoutSelectWrapper">
43
57
  <select bind:value={timeoutSelected} class="TimeoutSelect {isMobile ? 'TimeoutSelectMobile' : ''}">
@@ -47,7 +61,7 @@
47
61
  </select>
48
62
  </div>
49
63
  <div class="TimeoutActionButtons {isMobile ? 'TimeoutActionButtonsMobile' : ''}">
50
- <button class="TimeoutSave" on:click={() => saveTimeout()}>Save</button>
64
+ <button class="TimeoutSave" on:click={() => saveTimeout()}>{$_('timeout.save')}</button>
51
65
  </div>
52
66
  </div>
53
67
 
package/src/i18n.js ADDED
@@ -0,0 +1,27 @@
1
+ import {
2
+ dictionary,
3
+ locale,
4
+ addMessages,
5
+ _
6
+ } from 'svelte-i18n';
7
+
8
+ function setupI18n({ withLocale: _locale, translations }) {
9
+ locale.subscribe((data) => {
10
+ if (data == null) {
11
+ dictionary.set(translations);
12
+ locale.set(_locale);
13
+ }
14
+ }); // maybe we will need this to make sure that the i18n is set up only once
15
+ /*dictionary.set(translations);
16
+ locale.set(_locale);*/
17
+ }
18
+
19
+ function addNewMessages(lang, dict) {
20
+ addMessages(lang, dict);
21
+ }
22
+
23
+ function setLocale(_locale) {
24
+ locale.set(_locale);
25
+ }
26
+
27
+ export { _, setupI18n, addNewMessages, setLocale };
@@ -0,0 +1,34 @@
1
+ export const PlayerTimeoutTranslations = {
2
+ en: {
3
+ timeout: {
4
+ title: `Timeout`,
5
+ timeoutTextFirst: `Everymatrix provides you an easy way to take a break from the games. You can request automatic blocking of your account for 24 hours. During the temporary restraint, you will not be able to access your Account.`,
6
+ timeoutTextSecondary: `Please note that the “Time-out facility” does not in any case replace “Self-exclusion”. If you think you are experiencing a gambling addiction problem, please enter the link under "Responsible Gaming" and use the "Self-exclusion service" or contact us as soon as possible.`,
7
+ save: `Save`,
8
+ cooloff24: `CoolOffFor24Hours`,
9
+ cooloff7: `CoolOffFor7Days`,
10
+ cooloff30: `CoolOffFor30Days`,
11
+ cooloff3: `CoolOffFor3Months`,
12
+ cooloff24Text: `24 hours`,
13
+ cooloff7Text: `7 days`,
14
+ cooloff30Text: `30 days`,
15
+ cooloff3Text: `3 months`,
16
+ }
17
+ },
18
+ ro: {
19
+ timeout: {
20
+ title: `Timeout`,
21
+ timeoutTextFirst: `Everymatrix provides you an easy way to take a break from the games. You can request automatic blocking of your account for 24 hours. During the temporary restraint, you will not be able to access your Account.`,
22
+ timeoutTextSecondary: `Please note that the “Time-out facility” does not in any case replace “Self-exclusion”. If you think you are experiencing a gambling addiction problem, please enter the link under "Responsible Gaming" and use the "Self-exclusion service" or contact us as soon as possible.`,
23
+ save: `Save`,
24
+ cooloff24: `CoolOffFor24Hours`,
25
+ cooloff7: `CoolOffFor7Days`,
26
+ cooloff30: `CoolOffFor30Days`,
27
+ cooloff3: `CoolOffFor3Months`,
28
+ cooloff24Text: `24 hours`,
29
+ cooloff7Text: `7 days`,
30
+ cooloff30Text: `30 days`,
31
+ cooloff3Text: `3 months`,
32
+ }
33
+ }
34
+ };