poe-svelte-ui-lib 1.1.18 → 1.1.19
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- $lib/ElementsUI/ButtonProps.svelte -->
|
|
2
2
|
<script lang="ts">
|
|
3
|
-
import { t } from '../locales/i18n'
|
|
3
|
+
import { Language, t } from '../locales/i18n'
|
|
4
4
|
import { type UIComponent, type IButtonProps, type ISelectOption, updateProperty } from '../types'
|
|
5
5
|
import * as UI from '..'
|
|
6
6
|
import { optionsStore } from '../options'
|
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
(h.value as string).includes(component.properties.componentClass?.split(' ').find((cls: string) => cls.startsWith('py-'))),
|
|
39
39
|
),
|
|
40
40
|
)
|
|
41
|
+
|
|
42
|
+
$effect(() => {
|
|
43
|
+
console.log(Language)
|
|
44
|
+
})
|
|
41
45
|
</script>
|
|
42
46
|
|
|
43
47
|
{#if forConstructor}
|
package/dist/locales/i18n.d.ts
CHANGED
package/dist/locales/i18n.js
CHANGED
|
@@ -3,14 +3,17 @@ import { writable } from 'svelte/store';
|
|
|
3
3
|
import translations from './translations';
|
|
4
4
|
/* Язык по умолчанию */
|
|
5
5
|
let initialLanguage = 'ru';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
initialLanguage
|
|
6
|
+
export const getInitLanguage = () => {
|
|
7
|
+
/* Проверяем, доступен ли localStorage */
|
|
8
|
+
if (typeof window !== 'undefined') {
|
|
9
|
+
initialLanguage = localStorage.getItem('AppLanguage') || navigator.language?.split('-')[0]?.toLowerCase() || 'ru';
|
|
10
|
+
const supported = ['ru', 'en', 'zh'];
|
|
11
|
+
if (!supported.includes(initialLanguage)) {
|
|
12
|
+
initialLanguage = 'ru';
|
|
13
|
+
}
|
|
12
14
|
}
|
|
13
|
-
|
|
15
|
+
return initialLanguage;
|
|
16
|
+
};
|
|
14
17
|
/* Создаем хранилище с начальным значением языка */
|
|
15
18
|
export const Language = writable(initialLanguage);
|
|
16
19
|
/* Функция для изменения языка */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poe-svelte-ui-lib",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.19",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
36
|
-
"@tailwindcss/vite": "^4.1.
|
|
36
|
+
"@tailwindcss/vite": "^4.1.16",
|
|
37
37
|
"prettier": "^3.6.2",
|
|
38
38
|
"prettier-plugin-svelte": "^3.4.0",
|
|
39
39
|
"prettier-plugin-tailwindcss": "^0.7.1",
|
|
40
40
|
"tailwind-merge": "^3.3.1",
|
|
41
|
-
"tailwindcss": "^4.1.
|
|
41
|
+
"tailwindcss": "^4.1.16",
|
|
42
42
|
"tsx": "^4.20.6",
|
|
43
43
|
"typescript": "^5.9.3"
|
|
44
44
|
},
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
49
49
|
"@types/node": "^24.9.1",
|
|
50
50
|
"publint": "^0.3.15",
|
|
51
|
-
"svelte": "^5.41.
|
|
51
|
+
"svelte": "^5.41.3",
|
|
52
52
|
"svelte-preprocess": "^6.0.3",
|
|
53
|
-
"vite": "^7.1.
|
|
53
|
+
"vite": "^7.1.12",
|
|
54
54
|
"vite-plugin-compression": "^0.5.1"
|
|
55
55
|
}
|
|
56
56
|
}
|