@adminforth/i18n 1.1.2 → 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.2",
3
+ "version": "1.1.3-next.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
package/Changelog.md DELETED
@@ -1,71 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [1.0.23] - next
9
-
10
- ### Improved
11
-
12
- - Better instructions for LLM pluralization Slavik messages
13
-
14
- ### Added
15
- - support for pluralization in Backend `tr` function
16
- - add handy languagesList function to get all languages for translation of side apps
17
-
18
- ### Fixed
19
- - invalidation of indvidual tr messages when translation using LLM adapter
20
-
21
- ## [1.0.22]
22
-
23
- ### Fixed
24
-
25
- - More predictable class name
26
- - When loading unique translations from category, they were not registered if existing in other category
27
-
28
-
29
- ## [1.0.21] - 2024-12-30
30
-
31
- ### Fixed
32
- - improve cache reset when editing messages manually
33
-
34
- ### Added
35
- - Translating external app" feature by using feedCategoryTranslations
36
-
37
- ## [1.0.20]
38
-
39
- ### Fixed
40
- - fix automatic translations
41
-
42
- ## [1.0.14]
43
-
44
- ### Fixed
45
-
46
- - Add `ignoreInitial` for watch to prevent initial messages loading
47
- - Add locking mechanism to prevent initial messages loading call in parallel (just in case)
48
-
49
- ## [1.0.13]
50
-
51
- - Deduplicate frontend strings before creating translations
52
-
53
-
54
- ## [1.0.12]
55
-
56
- ### Fixed
57
-
58
- - live mode frontend translations loading when tmp dir is nopt preserver (e.g. docker cached /tmp pipeline)
59
-
60
- ## [1.0.11]
61
-
62
- ### Fixed
63
-
64
- - cache invalidations on delete
65
-
66
- ## [v1.0.10]
67
-
68
- ### Fixed
69
-
70
- - fix automatic translations for duplicate strings
71
- - improve slavik pluralization generations by splitting the requests