@adminforth/i18n 1.1.3-next.1 → 1.1.3-next.2

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/build.log CHANGED
@@ -4,6 +4,7 @@
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,620 bytes received 134 bytes 19,508.00 bytes/sec
15
- total size is 9,122 speedup is 0.94
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/i18n",
3
- "version": "1.1.3-next.1",
3
+ "version": "1.1.3-next.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",