@everymatrix/casino-game-thumbnail 1.1.2 → 1.1.5

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-game-thumbnail",
3
- "version": "1.1.2",
3
+ "version": "1.1.5",
4
4
  "main": "dist/casino-game-thumbnail.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": "a331dfb7a0daca971fec89907140c9353dc5f0b3"
39
+ "gitHead": "8382d5b109b967bd6756236bd96bb5a13d51e40e"
40
40
  }
@@ -4,13 +4,13 @@
4
4
  import moment from 'moment';
5
5
  import { onMount, tick } from "svelte";
6
6
  import { isMobile, getDevice } from 'rvhelper';
7
- import { _, addNewMessages} from './i18n';
7
+ import { _, addNewMessages, setLocale} from './i18n';
8
8
  import { GameThumbnailTranslations } from './translations';
9
9
  import { currenciesSymbols } from './currency-symbols';
10
10
 
11
11
  export let session:string = '';
12
12
  export let userid:string = '';
13
- export let lang:string = '';
13
+ export let lang:string = 'en';
14
14
  export let clientstyling:string = ''
15
15
  export let clientstylingurl:string = '';
16
16
  export let translationUrl:string = '';
@@ -246,8 +246,7 @@
246
246
  }
247
247
 
248
248
  const setActiveLanguage = ():void => {
249
- // Not needed yet
250
- // setLocale(lang);
249
+ setLocale(lang);
251
250
  }
252
251
 
253
252
  const setSession = ():void => {
@@ -596,6 +595,7 @@
596
595
  $: roulletteref && roulleteresults && attachAnimations();
597
596
  </script>
598
597
 
598
+
599
599
  <div class={`GameContainer ${extraclassname}`} part={`GameContainer ${extraclassname}`} bind:this={customStylingContainer}>
600
600
  <div class="GameInnerContainer { (livegamedata && !isopen && openhours.value) || (livegamedata && istablefull) ? 'GameInnerContainerUnavailable' : ''}" part="GameInnerContainer { (livegamedata && !isopen) || (livegamedata && istablefull) ? 'GameInnerContainerUnavailable' : ''}" on:mouseenter={gameHover} on:mouseleave={gameBlur} on:touchstart={gameTouch} on:touchend={gameTouchEnd}>
601
601
  <img src={gamethumbnail} class={`GameBg GameBg-${gamecellsize} ${hover ? 'GameContainerHovered' : ''} ${loaded ? 'Loaded' : ''}`} part="GameBg {hover ? 'GameContainerHovered' : ''} {loaded ? 'Loaded' : ''}" alt="" bind:this={image} loading="lazy" />
@@ -618,7 +618,9 @@
618
618
  {/if}
619
619
  {/if}
620
620
  <p class="GameInfoName" part="GameInfoName" title="{gamename}">{gamename}</p>
621
+ {#if lang}
621
622
  <button class="GameInfoBtn" part="GameInfoBtn" on:click="{() => toggleGameFrame(gameid)}">{$_('gameThumbnail.playNow')}</button>
623
+ {/if}
622
624
  </div>
623
625
  <span class="GameInfoVendor" part="GameInfoVendor">
624
626
  { gamevendor ? gamevendor : '-'}
@@ -706,7 +708,6 @@
706
708
  {/if}
707
709
  </div>
708
710
 
709
-
710
711
  <style lang="scss">
711
712
 
712
713
  :host {
package/src/i18n.js CHANGED
@@ -6,12 +6,22 @@ import {
6
6
  } from 'svelte-i18n';
7
7
 
8
8
  function setupI18n({ withLocale: _locale, translations }) {
9
- dictionary.set(translations);
10
- locale.set(_locale);
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);*/
11
17
  }
12
18
 
13
19
  function addNewMessages(lang, dict) {
14
20
  addMessages(lang, dict);
15
21
  }
16
22
 
17
- export { _, setupI18n, addNewMessages };
23
+ function setLocale(_locale) {
24
+ locale.set(_locale);
25
+ }
26
+
27
+ export { _, setupI18n, addNewMessages, setLocale };