@adminforth/i18n 1.1.3-next.1 → 1.1.3-next.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/README.md +2 -0
- package/build.log +4 -3
- package/custom/LanguageEveryPageLoader.vue +15 -0
- package/custom/LanguageInUserMenu.vue +0 -10
- package/custom/LanguageUnderLogin.vue +0 -10
- package/dist/custom/LanguageEveryPageLoader.vue +15 -0
- package/dist/custom/LanguageInUserMenu.vue +0 -10
- package/dist/custom/LanguageUnderLogin.vue +0 -10
- package/dist/index.js +4 -0
- package/index.ts +5 -0
- package/package.json +7 -3
package/README.md
ADDED
package/build.log
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
> @adminforth/i18n@1.0.
|
|
2
|
+
> @adminforth/i18n@1.0.0 build
|
|
3
3
|
> tsc && rsync -av --exclude 'node_modules' custom dist/
|
|
4
4
|
|
|
5
5
|
sending incremental file list
|
|
6
6
|
custom/
|
|
7
|
+
custom/LanguageEveryPageLoader.vue
|
|
7
8
|
custom/LanguageInUserMenu.vue
|
|
8
9
|
custom/LanguageUnderLogin.vue
|
|
9
10
|
custom/langCommon.ts
|
|
@@ -11,5 +12,5 @@ custom/package-lock.json
|
|
|
11
12
|
custom/package.json
|
|
12
13
|
custom/tsconfig.json
|
|
13
14
|
|
|
14
|
-
sent 9,
|
|
15
|
-
total size is
|
|
15
|
+
sent 9,498 bytes received 153 bytes 19,302.00 bytes/sec
|
|
16
|
+
total size is 8,926 speedup is 0.92
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template/>
|
|
2
|
+
|
|
3
|
+
<script setup>
|
|
4
|
+
import { onMounted } from 'vue';
|
|
5
|
+
import { useI18n } from 'vue-i18n';
|
|
6
|
+
import { setLang, getLocalLang } from './langCommon';
|
|
7
|
+
|
|
8
|
+
const { setLocaleMessage, locale } = useI18n();
|
|
9
|
+
|
|
10
|
+
const props = defineProps(['meta']);
|
|
11
|
+
|
|
12
|
+
onMounted(() => {
|
|
13
|
+
setLang({ setLocaleMessage, locale }, props.meta.pluginInstanceId, getLocalLang(props.meta.supportedLanguages));
|
|
14
|
+
});
|
|
15
|
+
</script>
|
|
@@ -87,16 +87,6 @@ const selectedOption = computed(() => {
|
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
onMounted(() => {
|
|
90
|
-
console.log('Language In user menu mounted', props.meta.supportedLanguages);
|
|
91
90
|
selectedLanguage.value = getLocalLang(props.meta.supportedLanguages);
|
|
92
|
-
setLang({ setLocaleMessage, locale }, props.meta.pluginInstanceId, selectedLanguage.value);
|
|
93
|
-
// todo this mounted executed only on this component mount, f5 from another page apart login will not read it
|
|
94
91
|
});
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
92
|
</script>
|
|
@@ -61,16 +61,6 @@ const options = computed(() => {
|
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
onMounted(() => {
|
|
64
|
-
console.log('LanguageUnderLogin mounted', props.meta.supportedLanguages);
|
|
65
64
|
selectedLanguage.value = getLocalLang(props.meta.supportedLanguages);
|
|
66
|
-
setLang({ setLocaleMessage, locale }, props.meta.pluginInstanceId, selectedLanguage.value);
|
|
67
|
-
// todo this mounted executed only on this component mount, f5 from another page apart login will not read it
|
|
68
65
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
66
|
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template/>
|
|
2
|
+
|
|
3
|
+
<script setup>
|
|
4
|
+
import { onMounted } from 'vue';
|
|
5
|
+
import { useI18n } from 'vue-i18n';
|
|
6
|
+
import { setLang, getLocalLang } from './langCommon';
|
|
7
|
+
|
|
8
|
+
const { setLocaleMessage, locale } = useI18n();
|
|
9
|
+
|
|
10
|
+
const props = defineProps(['meta']);
|
|
11
|
+
|
|
12
|
+
onMounted(() => {
|
|
13
|
+
setLang({ setLocaleMessage, locale }, props.meta.pluginInstanceId, getLocalLang(props.meta.supportedLanguages));
|
|
14
|
+
});
|
|
15
|
+
</script>
|
|
@@ -87,16 +87,6 @@ const selectedOption = computed(() => {
|
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
onMounted(() => {
|
|
90
|
-
console.log('Language In user menu mounted', props.meta.supportedLanguages);
|
|
91
90
|
selectedLanguage.value = getLocalLang(props.meta.supportedLanguages);
|
|
92
|
-
setLang({ setLocaleMessage, locale }, props.meta.pluginInstanceId, selectedLanguage.value);
|
|
93
|
-
// todo this mounted executed only on this component mount, f5 from another page apart login will not read it
|
|
94
91
|
});
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
92
|
</script>
|
|
@@ -61,16 +61,6 @@ const options = computed(() => {
|
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
onMounted(() => {
|
|
64
|
-
console.log('LanguageUnderLogin mounted', props.meta.supportedLanguages);
|
|
65
64
|
selectedLanguage.value = getLocalLang(props.meta.supportedLanguages);
|
|
66
|
-
setLang({ setLocaleMessage, locale }, props.meta.pluginInstanceId, selectedLanguage.value);
|
|
67
|
-
// todo this mounted executed only on this component mount, f5 from another page apart login will not read it
|
|
68
65
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
66
|
</script>
|
package/dist/index.js
CHANGED
|
@@ -222,6 +222,10 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
222
222
|
file: this.componentPath('LanguageInUserMenu.vue'),
|
|
223
223
|
meta: compMeta
|
|
224
224
|
});
|
|
225
|
+
adminforth.config.customization.globalInjections.everyPageBottom.push({
|
|
226
|
+
file: this.componentPath('LanguageEveryPageLoader.vue'),
|
|
227
|
+
meta: compMeta
|
|
228
|
+
});
|
|
225
229
|
// disable create allowedActions for translations
|
|
226
230
|
resourceConfig.options.allowedActions.create = false;
|
|
227
231
|
// add hook to validate user did not screw up with template params
|
package/index.ts
CHANGED
|
@@ -250,6 +250,11 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
250
250
|
meta: compMeta
|
|
251
251
|
});
|
|
252
252
|
|
|
253
|
+
adminforth.config.customization.globalInjections.everyPageBottom.push({
|
|
254
|
+
file: this.componentPath('LanguageEveryPageLoader.vue'),
|
|
255
|
+
meta: compMeta
|
|
256
|
+
});
|
|
257
|
+
|
|
253
258
|
// disable create allowedActions for translations
|
|
254
259
|
resourceConfig.options.allowedActions.create = false;
|
|
255
260
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminforth/i18n",
|
|
3
|
-
"version": "1.1.3-next.
|
|
3
|
+
"version": "1.1.3-next.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"homepage": "https://adminforth.dev/docs/tutorial/Plugins/i18n/",
|
|
7
8
|
"scripts": {
|
|
8
9
|
"build": "tsc && rsync -av --exclude 'node_modules' custom dist/",
|
|
9
10
|
"prepare": "npm link adminforth"
|
|
@@ -15,11 +16,14 @@
|
|
|
15
16
|
"keywords": [
|
|
16
17
|
"i18n",
|
|
17
18
|
"adminforth",
|
|
18
|
-
"translation"
|
|
19
|
+
"translation",
|
|
20
|
+
"internationalization",
|
|
21
|
+
"language",
|
|
22
|
+
"vue-i18n"
|
|
19
23
|
],
|
|
20
24
|
"author": "devforth",
|
|
21
25
|
"license": "ISC",
|
|
22
|
-
"description": "Internationalization plugin for
|
|
26
|
+
"description": "Internationalization/translation plugin for AdminForth",
|
|
23
27
|
"dependencies": {
|
|
24
28
|
"@aws-sdk/client-ses": "^3.654.0",
|
|
25
29
|
"@sapphire/async-queue": "^1.5.5",
|