@everymatrix/lottery-hakuna-ticket 0.0.1
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/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-14ac4886.js +1356 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/lottery-button_6.cjs.entry.js +967 -0
- package/dist/cjs/lottery-hakuna-ticket-a4c6f2d2.js +384 -0
- package/dist/cjs/lottery-hakuna-ticket.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +43 -0
- package/dist/collection/components/lottery-hakuna-ticket/index.js +1 -0
- package/dist/collection/components/lottery-hakuna-ticket/lottery-hakuna-ticket.css +113 -0
- package/dist/collection/components/lottery-hakuna-ticket/lottery-hakuna-ticket.js +622 -0
- package/dist/collection/components/lottery-hakuna-ticket/lottery-hakuna-ticket.types.js +5 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +85 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-032d8575.js +1328 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/lottery-button_6.entry.js +959 -0
- package/dist/esm/lottery-hakuna-ticket-2019142e.js +379 -0
- package/dist/esm/lottery-hakuna-ticket.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/lottery-hakuna-ticket/app-globals-0f993ce5.js +1 -0
- package/dist/lottery-hakuna-ticket/index-032d8575.js +2 -0
- package/dist/lottery-hakuna-ticket/index.esm.js +1 -0
- package/dist/lottery-hakuna-ticket/lottery-button_6.entry.js +1 -0
- package/dist/lottery-hakuna-ticket/lottery-hakuna-ticket-2019142e.js +1 -0
- package/dist/lottery-hakuna-ticket/lottery-hakuna-ticket.esm.js +1 -0
- package/dist/stencil.config.dev.js +19 -0
- package/dist/stencil.config.js +19 -0
- package/dist/storybook/main.js +43 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket/.stencil/packages/stencil/lottery-hakuna-ticket/stencil.config.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket/.stencil/packages/stencil/lottery-hakuna-ticket/stencil.config.dev.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket/.stencil/packages/stencil/lottery-hakuna-ticket/storybook/main.d.ts +3 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket/.stencil/packages/stencil/lottery-hakuna-ticket/storybook/preview.d.ts +70 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket/.stencil/tools/plugins/index.d.ts +4 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
- package/dist/types/components/lottery-hakuna-ticket/index.d.ts +1 -0
- package/dist/types/components/lottery-hakuna-ticket/lottery-hakuna-ticket.d.ts +110 -0
- package/dist/types/components/lottery-hakuna-ticket/lottery-hakuna-ticket.types.d.ts +97 -0
- package/dist/types/components.d.ts +190 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/locale.utils.d.ts +3 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +27 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
2
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'hr'];
|
|
3
|
+
const TRANSLATIONS = {
|
|
4
|
+
en: {
|
|
5
|
+
ticket: 'Ticket',
|
|
6
|
+
loading: 'Loading, please wait ...',
|
|
7
|
+
error: 'It was an error while trying to fetch the data',
|
|
8
|
+
quickPick: 'Quick Pick',
|
|
9
|
+
submit: 'SUBMIT'
|
|
10
|
+
},
|
|
11
|
+
ro: {
|
|
12
|
+
loading: 'Se incarca, va rugam asteptati ...',
|
|
13
|
+
error: 'A fost o eroare in timp ce asteptam datele',
|
|
14
|
+
multiplier: 'Multiplicator',
|
|
15
|
+
numberOfDraws: 'Numarul de extrageri',
|
|
16
|
+
wagerPerDraw: 'Pariul per extragere',
|
|
17
|
+
resetButton: 'Reseteaza',
|
|
18
|
+
autoButton: 'quick pick',
|
|
19
|
+
lines: 'Select how many lines you want to buy',
|
|
20
|
+
lineName: 'Line',
|
|
21
|
+
playType: 'Select one play type you want to buy'
|
|
22
|
+
},
|
|
23
|
+
fr: {
|
|
24
|
+
loading: 'Loading, please wait ...',
|
|
25
|
+
error: 'It was an error while trying to fetch the data',
|
|
26
|
+
multiplier: 'Multiplier',
|
|
27
|
+
numberOfDraws: 'Number of Draws',
|
|
28
|
+
wagerPerDraw: 'Wager per Draw',
|
|
29
|
+
resetButton: 'Reset',
|
|
30
|
+
autoButton: 'quick pick',
|
|
31
|
+
lines: 'Select how many lines you want to buy',
|
|
32
|
+
lineName: 'Line',
|
|
33
|
+
playType: 'Select one play type you want to buy'
|
|
34
|
+
},
|
|
35
|
+
ar: {
|
|
36
|
+
loading: 'Loading, please wait ...',
|
|
37
|
+
error: 'It was an error while trying to fetch the data',
|
|
38
|
+
multiplier: 'Multiplier',
|
|
39
|
+
numberOfDraws: 'Number of Draws',
|
|
40
|
+
wagerPerDraw: 'Wager per Draw',
|
|
41
|
+
resetButton: 'Reset',
|
|
42
|
+
autoButton: 'quick pick',
|
|
43
|
+
lines: 'Select how many lines you want to buy',
|
|
44
|
+
lineName: 'Line',
|
|
45
|
+
playType: 'Select one play type you want to buy'
|
|
46
|
+
},
|
|
47
|
+
hr: {
|
|
48
|
+
loading: 'Učitavanje, molimo pričekajte ...',
|
|
49
|
+
error: 'Došlo je do pogreške prilikom pokušaja dohvaćanja podataka',
|
|
50
|
+
multiplier: 'Multiplikator',
|
|
51
|
+
numberOfDraws: 'Broj izvlačenja',
|
|
52
|
+
wagerPerDraw: 'Ulog po izvlačenju',
|
|
53
|
+
resetButton: 'Resetiraj',
|
|
54
|
+
autoButton: 'quick pick',
|
|
55
|
+
lines: 'Select how many lines you want to buy',
|
|
56
|
+
lineName: 'Line',
|
|
57
|
+
playType: 'Select one play type you want to buy'
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
export const translate = (key, customLang) => {
|
|
61
|
+
const lang = customLang;
|
|
62
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
63
|
+
};
|
|
64
|
+
export const getTranslations = (data) => {
|
|
65
|
+
Object.keys(data).forEach((item) => {
|
|
66
|
+
for (let key in data[item]) {
|
|
67
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
export const resolveTranslationUrl = async (translationUrl) => {
|
|
72
|
+
if (translationUrl) {
|
|
73
|
+
try {
|
|
74
|
+
const response = await fetch(translationUrl);
|
|
75
|
+
if (!response.ok) {
|
|
76
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
77
|
+
}
|
|
78
|
+
const translations = await response.json();
|
|
79
|
+
getTranslations(translations);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
console.error('Failed to fetch or parse translations from URL:', error);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|