@everymatrix/player-account-controller 0.0.260 → 0.0.261

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-controller",
3
- "version": "0.0.260",
3
+ "version": "0.0.261",
4
4
  "main": "dist/player-account-controller.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -29,8 +29,8 @@
29
29
  "typescript": "^3.9.3"
30
30
  },
31
31
  "dependencies": {
32
- "@everymatrix/player-account-menu": "^0.0.260",
33
- "@everymatrix/player-account-notifications": "^0.0.260",
32
+ "@everymatrix/player-account-menu": "^0.0.261",
33
+ "@everymatrix/player-account-notifications": "^0.0.261",
34
34
  "cross-env": "^7.0.3",
35
35
  "sirv-cli": "^1.0.0",
36
36
  "svelte": "^3.0.0"
@@ -38,5 +38,5 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "a30fdd6f6180c69aabbc0daf1bf2a2e1342bf0e2"
41
+ "gitHead": "a93c0ae8104c039af7d54949a0889c11bca83acb"
42
42
  }
@@ -4,6 +4,7 @@
4
4
  import { onMount, tick } from 'svelte';
5
5
  import { getDevice } from 'rvhelper';
6
6
  import { _, addNewMessages, setLocale, setupI18n } from './i18n';
7
+ import { PlayerAccountControllerTranslations } from './translations';
7
8
 
8
9
  import '@everymatrix/player-account-menu';
9
10
  import '@everymatrix/player-account-notifications';
@@ -90,6 +91,10 @@
90
91
 
91
92
  let switchContent:boolean = false;
92
93
 
94
+ Object.keys(PlayerAccountControllerTranslations).forEach((item:any) => {
95
+ addNewMessages(item, PlayerAccountControllerTranslations[item]);
96
+ });
97
+
93
98
  const messageHandler = (e:any):void => {
94
99
  let url:URL;
95
100
 
@@ -104,6 +109,9 @@
104
109
  switchContent = true;
105
110
  pagePath = e.data.page.path;
106
111
  selected = e.data.page.id;
112
+ if(pagePath == '/profile-info') {
113
+ getUserProfileInfo();
114
+ }
107
115
  break;
108
116
 
109
117
  case 'SetActivePage':
@@ -174,7 +182,7 @@
174
182
  if (res.status == 200) {
175
183
  window.postMessage({ type: 'WidgetNotification', data: {
176
184
  type: 'success',
177
- message: 'Profile updated!'
185
+ message: $_('playerAccount.profileUpdateSuccess')
178
186
  }}, window.location.href);
179
187
  window.postMessage({ type: 'ConfirmProfileInfoSave' }, window.location.href);
180
188
  }
@@ -211,7 +219,7 @@
211
219
  if (res.status == 200) {
212
220
  window.postMessage({ type: 'WidgetNotification', data: {
213
221
  type: 'success',
214
- message: 'Timeout active'
222
+ message: $_('playerAccount.timeoutSuccess')
215
223
  }}, window.location.href);
216
224
  window.postMessage({ type: 'LogoutSuccessfull' }, window.location.href);
217
225
  } else {
@@ -249,7 +257,7 @@
249
257
  if (res.status == 200) {
250
258
  window.postMessage({ type: 'WidgetNotification', data: {
251
259
  type: 'success',
252
- message: 'Self exclusion active'
260
+ message: $_('playerAccount.selfExclusionSuccess')
253
261
  }}, window.location.href);
254
262
  window.postMessage({ type: 'LogoutSuccessfull'}, window.location.href);
255
263
  } else {
@@ -286,7 +294,7 @@
286
294
  if (res.status == 200) {
287
295
  window.postMessage({ type: 'WidgetNotification', data: {
288
296
  type: 'success',
289
- message: 'Account closed'
297
+ message: $_('playerAccount.accountClosureSuccess')
290
298
  }}, window.location.href);
291
299
  window.postMessage({ type: 'LogoutSuccessfull'}, window.location.href);
292
300
  } else {
@@ -326,7 +334,7 @@
326
334
 
327
335
  window.postMessage({ type: 'WidgetNotification', data: {
328
336
  type: 'success',
329
- message: 'Limits updated'
337
+ message: $_('playerAccount.limitsUpdateSuccess')
330
338
  }}, window.location.href);
331
339
 
332
340
  getGamingLimits(new URL(`${endpoint}/player/${playerid}/limits`));
@@ -394,7 +402,7 @@
394
402
  showdeletenotification = true;
395
403
  window.postMessage({ type: 'WidgetNotification', data: {
396
404
  type: 'success',
397
- message: 'Limits deleted'
405
+ message: $_('playerAccount.limitsDeleteSuccess')
398
406
  }}, window.location.href);
399
407
  getGamingLimits(new URL(`${endpoint}/player/${playerid}/limits`));
400
408
  } else {
@@ -478,7 +486,7 @@
478
486
  window.postMessage({ type: 'PasswordChangedSuccessfully' }, window.location.href);
479
487
  window.postMessage({ type: 'WidgetNotification', data: {
480
488
  type: 'success',
481
- message: 'Password changed successfully'
489
+ message: $_('playerAccount.passwordChangedSuccess')
482
490
  }}, window.location.href);
483
491
  } else {
484
492
  let dataResponse:any = await response.json();
@@ -533,7 +541,7 @@
533
541
  window.postMessage({ type: 'RealityCheckValueUpdated' }, window.location.href);
534
542
  window.postMessage({ type: 'WidgetNotification', data: {
535
543
  type: 'success',
536
- message: 'Reality check options saved'
544
+ message: $_('playerAccount.realityCheckSuccess')
537
545
  }}, window.location.href);
538
546
  }
539
547
  }, (err:any) => {
@@ -0,0 +1,26 @@
1
+ export const PlayerAccountControllerTranslations = {
2
+ en: {
3
+ playerAccount: {
4
+ profileUpdateSuccess: 'Profile updated!',
5
+ timeoutSuccess: 'Timeout active',
6
+ selfExclusionSuccess: 'Self exclusion active',
7
+ accountClosureSuccess: 'Account closed',
8
+ limitsUpdateSuccess: 'Limits updated',
9
+ limitsDeleteSuccess: 'Limits deleted',
10
+ passwordChangedSuccess: 'Password changed successfully',
11
+ realityCheckSuccess: 'Reality check options saved'
12
+ }
13
+ },
14
+ ro: {
15
+ playerAccount: {
16
+ profileUpdateSuccess: 'Profil updatat!',
17
+ timeoutSuccess: 'Timeout activ',
18
+ selfExclusionSuccess: 'Auto-excludere activa',
19
+ accountClosureSuccess: 'Cont inchis',
20
+ limitsUpdateSuccess: 'Limite updatate',
21
+ limitsDeleteSuccess: 'Limite sterse',
22
+ passwordChangedSuccess: 'Parola schimbata cu success',
23
+ realityCheckSuccess: 'Optiunile de verificare de timp salvate'
24
+ }
25
+ }
26
+ };