@everymatrix/casino-last-played-section 1.3.2 → 1.3.3

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-last-played-section",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "main": "index.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": "6f5109fe10945e3602504893215ac687784c4156"
39
+ "gitHead": "a3f9e9cbbb1c3537031608dfbcfd6293c7ec408b"
40
40
  }
@@ -2,7 +2,8 @@
2
2
  <script lang="ts">
3
3
 
4
4
  import { getDevice } from 'rvhelper';
5
- import { _, setLocale } from './i18n';
5
+ import { _, addNewMessages, setLocale } from './i18n';
6
+ import { LastPlayedTranslations } from './translations.js';
6
7
  import '@everymatrix/casino-games-category-section'
7
8
 
8
9
  export let endpoint:string = '';
@@ -13,6 +14,7 @@
13
14
  export let userid:string = ''; // Value for UserID;
14
15
  export let clientstyling:string = '';
15
16
  export let clientstylingurl:string = '';
17
+ export let translationurl:string = '';
16
18
 
17
19
  export let livecasino:string = 'false';
18
20
  export let integratedgameframemobile:string = 'false';
@@ -33,6 +35,23 @@
33
35
  let isLoading:boolean = false;
34
36
 
35
37
  let customStylingContainer:HTMLElement;
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
+
52
+ Object.keys(LastPlayedTranslations).forEach((item:any):void => {
53
+ addNewMessages(item, LastPlayedTranslations[item]);
54
+ });
36
55
 
37
56
  const getLastPlayedCategory = (options:any) => {
38
57
  return new Promise((resolve, reject) => {
@@ -144,15 +163,16 @@
144
163
  }
145
164
 
146
165
  $: endpoint && userid && lang && initialLoad();
166
+ $: translationurl && setTranslationUrl();
147
167
  $: clientstyling && customStylingContainer && setClientStyling();
148
168
  $: clientstylingurl && customStylingContainer && setClientStylingURL();
149
169
  $: lang && setActiveLanguage();
150
170
  </script>
151
171
 
152
172
  <div class="CasinoGamesCategorySectionContainer" bind:this={customStylingContainer}>
153
- <div class="casino-last-played-section">
173
+ <div class="CasinoLastPlayedSection">
154
174
  {#if lastPlayedEmpty}
155
- <p class="SearchLoading">No games in last played</p>
175
+ <p class="SearchLoading"> {$_('LastPlayedTranslations.noRecentGames')}</p>
156
176
  {:else}
157
177
  <casino-games-category-section
158
178
  session={session}
@@ -194,7 +214,7 @@
194
214
  box-sizing: border-box;
195
215
  }
196
216
 
197
- .casino-last-played-section {
217
+ .CasinoLastPlayedSection {
198
218
  background: var(--emfe-w-color-contrast, #07072A);
199
219
  color: var(--emfe-w-color-white, #FFFFFF);
200
220
  }
@@ -0,0 +1,12 @@
1
+ export const LastPlayedTranslations = {
2
+ en: {
3
+ LastPlayedTranslations: {
4
+ noRecentGames: "You haven't played yet but here you will find in the future a list of your games.",
5
+ },
6
+ },
7
+ de: {
8
+ LastPlayedTranslations: {
9
+ noRecentGames: "Du hast bisher noch nicht gespielt, aber hier findest du in Zukunft eine Liste deiner Spiele.",
10
+ },
11
+ },
12
+ };