@adminforth/i18n 3.0.0 → 3.1.0

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
@@ -6,7 +6,6 @@ sending incremental file list
6
6
  custom/
7
7
  custom/BulkActionButton.vue
8
8
  custom/LanguageEveryPageLoader.vue
9
- custom/LanguageFlag.vue
10
9
  custom/LanguageInUserMenu.vue
11
10
  custom/LanguageUnderLogin.vue
12
11
  custom/ListCell.vue
@@ -21,5 +20,5 @@ custom/package.json
21
20
  custom/pnpm-lock.yaml
22
21
  custom/tsconfig.json
23
22
 
24
- sent 45,404 bytes received 324 bytes 91,456.00 bytes/sec
25
- total size is 44,165 speedup is 0.97
23
+ sent 44,008 bytes received 305 bytes 88,626.00 bytes/sec
24
+ total size is 42,840 speedup is 0.97
@@ -38,7 +38,7 @@
38
38
  <div class="col-span-2 grid grid-cols-3 gap-x-2 gap-y-3 mt-4">
39
39
  <Checkbox v-for="(index, lang) in checkedLanguages" :key="lang" v-model="checkedLanguages[lang]">
40
40
  <span class="flex items-center gap-2">
41
- <LanguageFlag :countryCode="props.meta.countryCodes[lang]" />
41
+ <CountryFlag size="sm" :countryCode="props.meta.countryCodes[lang]" />
42
42
  {{ ISO6391.getName(lang.slice(0,2)) }} ({{ lang }})
43
43
  </span>
44
44
  </Checkbox>
@@ -51,13 +51,12 @@
51
51
  <script setup lang="ts">
52
52
  import { IconLanguages } from '@iconify-prerendered/vue-lucide';
53
53
  import { useI18n } from 'vue-i18n';
54
- import { Dialog, Button, Checkbox, Spinner } from '@/afcl';
54
+ import { Dialog, Button, Checkbox, CountryFlag, Spinner } from '@/afcl';
55
55
  import { computed, onMounted, ref, onUnmounted } from 'vue';
56
56
  import { callAdminForthApi } from '@/utils';
57
57
  import { useAdminforth } from '@/adminforth';
58
58
  import { getName, overwrite } from 'country-list';
59
59
  import ISO6391 from 'iso-639-1';
60
- import LanguageFlag from './LanguageFlag.vue';
61
60
  import websocket from '@/websocket';
62
61
  import { useFiltersStore } from '@/stores/filters';
63
62
  import { useBackgroundJobApi } from '@/custom/plugins/BackgroundJobsPlugin/useBackgroundJobApi.ts';
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <DropdownMenuAccordion class="af-language-in-user-menu" :label="selectedOption.label" :triggerClass="USER_MENU_ITEM_CLASSES">
3
3
  <template #icon>
4
- <LanguageFlag :countryCode="selectedOption.countryCode" />
4
+ <CountryFlag size="sm" :countryCode="selectedOption.countryCode" />
5
5
  </template>
6
6
  <DropdownMenuItem
7
7
  v-for="option in options.filter((opt) => opt.value !== selectedOption.value)"
@@ -10,7 +10,7 @@
10
10
  @click="doChangeLang(option.value)"
11
11
  >
12
12
  <template #icon>
13
- <LanguageFlag :countryCode="option.countryCode" />
13
+ <CountryFlag size="sm" :countryCode="option.countryCode" />
14
14
  </template>
15
15
  {{ option.label }}
16
16
  </DropdownMenuItem>
@@ -18,9 +18,8 @@
18
18
  </template>
19
19
 
20
20
  <script setup>
21
- import { DropdownMenuAccordion, DropdownMenuItem } from '@/afcl';
22
21
  import { USER_MENU_ITEM_CLASSES } from '@/utils/userMenu';
23
- import LanguageFlag from './LanguageFlag.vue';
22
+ import { CountryFlag, DropdownMenuAccordion, DropdownMenuItem } from '@/afcl';
24
23
 
25
24
  import { setLang, getLocalLang, setLocalLang, getLanguageOptions } from './langCommon';
26
25
 
@@ -8,14 +8,14 @@
8
8
  >
9
9
  <template #item="{ option }">
10
10
  <span class="flex items-center gap-2">
11
- <LanguageFlag :countryCode="option.countryCode" />
11
+ <CountryFlag size="sm" :countryCode="option.countryCode" />
12
12
  {{ option.label }}
13
13
  </span>
14
14
  </template>
15
15
 
16
16
  <template #selected-item="{ option }">
17
17
  <span class="flex items-center gap-2">
18
- <LanguageFlag :countryCode="option.countryCode" />
18
+ <CountryFlag size="sm" :countryCode="option.countryCode" />
19
19
  {{ option.label }}
20
20
  </span>
21
21
  </template>
@@ -24,8 +24,7 @@
24
24
  </template>
25
25
 
26
26
  <script setup>
27
- import Select from '@/afcl/Select.vue';
28
- import LanguageFlag from './LanguageFlag.vue';
27
+ import { CountryFlag, Select } from '@/afcl';
29
28
  import { setLang, getLocalLang, getLanguageOptions } from './langCommon';
30
29
  import { useCoreStore } from '@/stores/core';
31
30
 
@@ -21,7 +21,7 @@
21
21
  {{ task.state?.taskName }} to
22
22
  </span>
23
23
  <div class="flex items-center gap-2 shrink-0">
24
- <LanguageFlag :countryCode="task.state?.countryCode" />
24
+ <CountryFlag size="sm" :countryCode="task.state?.countryCode" />
25
25
  <component
26
26
  :is="getCustomComponent({file: '@@/plugins/BackgroundJobsPlugin/StateToIcon.vue'})"
27
27
  :status="task.status"
@@ -62,9 +62,8 @@ import { useI18n } from 'vue-i18n'
62
62
  import { computed, onMounted, onUnmounted, ref } from 'vue';
63
63
  import websocket from '@/websocket';
64
64
  import { getCustomComponent } from '@/utils';
65
- import { Button, Spinner } from '@/afcl';
65
+ import { Button, CountryFlag, Spinner } from '@/afcl';
66
66
  import { IconChevronLeft, IconChevronRight } from '@iconify-prerendered/vue-lucide';
67
- import LanguageFlag from './LanguageFlag.vue';
68
67
 
69
68
  const { t } = useI18n();
70
69
 
@@ -12,9 +12,7 @@
12
12
  "country-list": "^2.4.1",
13
13
  "iso-639-1": "^3.1.5"
14
14
  },
15
- "devDependencies": {
16
- "flag-icon-css": "^4.1.7"
17
- }
15
+ "devDependencies": {}
18
16
  },
19
17
  "node_modules/country-list": {
20
18
  "version": "2.4.1",
@@ -22,14 +20,6 @@
22
20
  "integrity": "sha512-KhVV/UfUV3dSNpsWIqHTQxLpYDKPKz1UwkRjadt+YbX2PRhyCEihEoS5XgB7J7AMXpkicvl+tRHvkNI5wbji/g==",
23
21
  "license": "MIT"
24
22
  },
25
- "node_modules/flag-icon-css": {
26
- "version": "4.1.7",
27
- "resolved": "https://registry.npmjs.org/flag-icon-css/-/flag-icon-css-4.1.7.tgz",
28
- "integrity": "sha512-AFjSU+fv98XbU0vnTQ32vcLj89UEr1MhwDFcooQv14qWJCjg9fGZzfh9BVyDhAhIOZW/pGmJmq38RqpgPaeybQ==",
29
- "deprecated": "The project has been renamed to flag-icons",
30
- "dev": true,
31
- "license": "MIT"
32
- },
33
23
  "node_modules/iso-639-1": {
34
24
  "version": "3.1.5",
35
25
  "resolved": "https://registry.npmjs.org/iso-639-1/-/iso-639-1-3.1.5.tgz",
@@ -10,7 +10,6 @@
10
10
  "license": "ISC",
11
11
  "description": "",
12
12
  "devDependencies": {
13
- "flag-icon-css": "^4.1.7"
14
13
  },
15
14
  "dependencies": {
16
15
  "country-list": "^2.4.1",
@@ -14,20 +14,12 @@ importers:
14
14
  iso-639-1:
15
15
  specifier: ^3.1.5
16
16
  version: 3.1.5
17
- devDependencies:
18
- flag-icon-css:
19
- specifier: ^4.1.7
20
- version: 4.1.7
21
17
 
22
18
  packages:
23
19
 
24
20
  country-list@2.4.1:
25
21
  resolution: {integrity: sha512-KhVV/UfUV3dSNpsWIqHTQxLpYDKPKz1UwkRjadt+YbX2PRhyCEihEoS5XgB7J7AMXpkicvl+tRHvkNI5wbji/g==}
26
22
 
27
- flag-icon-css@4.1.7:
28
- resolution: {integrity: sha512-AFjSU+fv98XbU0vnTQ32vcLj89UEr1MhwDFcooQv14qWJCjg9fGZzfh9BVyDhAhIOZW/pGmJmq38RqpgPaeybQ==}
29
- deprecated: The project has been renamed to flag-icons
30
-
31
23
  iso-639-1@3.1.5:
32
24
  resolution: {integrity: sha512-gXkz5+KN7HrG0Q5UGqSMO2qB9AsbEeyLP54kF1YrMsIxmu+g4BdB7rflReZTSTZGpfj8wywu6pfPBCylPIzGQA==}
33
25
  engines: {node: '>=6.0'}
@@ -36,6 +28,4 @@ snapshots:
36
28
 
37
29
  country-list@2.4.1: {}
38
30
 
39
- flag-icon-css@4.1.7: {}
40
-
41
31
  iso-639-1@3.1.5: {}
@@ -38,7 +38,7 @@
38
38
  <div class="col-span-2 grid grid-cols-3 gap-x-2 gap-y-3 mt-4">
39
39
  <Checkbox v-for="(index, lang) in checkedLanguages" :key="lang" v-model="checkedLanguages[lang]">
40
40
  <span class="flex items-center gap-2">
41
- <LanguageFlag :countryCode="props.meta.countryCodes[lang]" />
41
+ <CountryFlag size="sm" :countryCode="props.meta.countryCodes[lang]" />
42
42
  {{ ISO6391.getName(lang.slice(0,2)) }} ({{ lang }})
43
43
  </span>
44
44
  </Checkbox>
@@ -51,13 +51,12 @@
51
51
  <script setup lang="ts">
52
52
  import { IconLanguages } from '@iconify-prerendered/vue-lucide';
53
53
  import { useI18n } from 'vue-i18n';
54
- import { Dialog, Button, Checkbox, Spinner } from '@/afcl';
54
+ import { Dialog, Button, Checkbox, CountryFlag, Spinner } from '@/afcl';
55
55
  import { computed, onMounted, ref, onUnmounted } from 'vue';
56
56
  import { callAdminForthApi } from '@/utils';
57
57
  import { useAdminforth } from '@/adminforth';
58
58
  import { getName, overwrite } from 'country-list';
59
59
  import ISO6391 from 'iso-639-1';
60
- import LanguageFlag from './LanguageFlag.vue';
61
60
  import websocket from '@/websocket';
62
61
  import { useFiltersStore } from '@/stores/filters';
63
62
  import { useBackgroundJobApi } from '@/custom/plugins/BackgroundJobsPlugin/useBackgroundJobApi.ts';
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <DropdownMenuAccordion class="af-language-in-user-menu" :label="selectedOption.label" :triggerClass="USER_MENU_ITEM_CLASSES">
3
3
  <template #icon>
4
- <LanguageFlag :countryCode="selectedOption.countryCode" />
4
+ <CountryFlag size="sm" :countryCode="selectedOption.countryCode" />
5
5
  </template>
6
6
  <DropdownMenuItem
7
7
  v-for="option in options.filter((opt) => opt.value !== selectedOption.value)"
@@ -10,7 +10,7 @@
10
10
  @click="doChangeLang(option.value)"
11
11
  >
12
12
  <template #icon>
13
- <LanguageFlag :countryCode="option.countryCode" />
13
+ <CountryFlag size="sm" :countryCode="option.countryCode" />
14
14
  </template>
15
15
  {{ option.label }}
16
16
  </DropdownMenuItem>
@@ -18,9 +18,8 @@
18
18
  </template>
19
19
 
20
20
  <script setup>
21
- import { DropdownMenuAccordion, DropdownMenuItem } from '@/afcl';
22
21
  import { USER_MENU_ITEM_CLASSES } from '@/utils/userMenu';
23
- import LanguageFlag from './LanguageFlag.vue';
22
+ import { CountryFlag, DropdownMenuAccordion, DropdownMenuItem } from '@/afcl';
24
23
 
25
24
  import { setLang, getLocalLang, setLocalLang, getLanguageOptions } from './langCommon';
26
25
 
@@ -8,14 +8,14 @@
8
8
  >
9
9
  <template #item="{ option }">
10
10
  <span class="flex items-center gap-2">
11
- <LanguageFlag :countryCode="option.countryCode" />
11
+ <CountryFlag size="sm" :countryCode="option.countryCode" />
12
12
  {{ option.label }}
13
13
  </span>
14
14
  </template>
15
15
 
16
16
  <template #selected-item="{ option }">
17
17
  <span class="flex items-center gap-2">
18
- <LanguageFlag :countryCode="option.countryCode" />
18
+ <CountryFlag size="sm" :countryCode="option.countryCode" />
19
19
  {{ option.label }}
20
20
  </span>
21
21
  </template>
@@ -24,8 +24,7 @@
24
24
  </template>
25
25
 
26
26
  <script setup>
27
- import Select from '@/afcl/Select.vue';
28
- import LanguageFlag from './LanguageFlag.vue';
27
+ import { CountryFlag, Select } from '@/afcl';
29
28
  import { setLang, getLocalLang, getLanguageOptions } from './langCommon';
30
29
  import { useCoreStore } from '@/stores/core';
31
30
 
@@ -21,7 +21,7 @@
21
21
  {{ task.state?.taskName }} to
22
22
  </span>
23
23
  <div class="flex items-center gap-2 shrink-0">
24
- <LanguageFlag :countryCode="task.state?.countryCode" />
24
+ <CountryFlag size="sm" :countryCode="task.state?.countryCode" />
25
25
  <component
26
26
  :is="getCustomComponent({file: '@@/plugins/BackgroundJobsPlugin/StateToIcon.vue'})"
27
27
  :status="task.status"
@@ -62,9 +62,8 @@ import { useI18n } from 'vue-i18n'
62
62
  import { computed, onMounted, onUnmounted, ref } from 'vue';
63
63
  import websocket from '@/websocket';
64
64
  import { getCustomComponent } from '@/utils';
65
- import { Button, Spinner } from '@/afcl';
65
+ import { Button, CountryFlag, Spinner } from '@/afcl';
66
66
  import { IconChevronLeft, IconChevronRight } from '@iconify-prerendered/vue-lucide';
67
- import LanguageFlag from './LanguageFlag.vue';
68
67
 
69
68
  const { t } = useI18n();
70
69
 
@@ -12,9 +12,7 @@
12
12
  "country-list": "^2.4.1",
13
13
  "iso-639-1": "^3.1.5"
14
14
  },
15
- "devDependencies": {
16
- "flag-icon-css": "^4.1.7"
17
- }
15
+ "devDependencies": {}
18
16
  },
19
17
  "node_modules/country-list": {
20
18
  "version": "2.4.1",
@@ -22,14 +20,6 @@
22
20
  "integrity": "sha512-KhVV/UfUV3dSNpsWIqHTQxLpYDKPKz1UwkRjadt+YbX2PRhyCEihEoS5XgB7J7AMXpkicvl+tRHvkNI5wbji/g==",
23
21
  "license": "MIT"
24
22
  },
25
- "node_modules/flag-icon-css": {
26
- "version": "4.1.7",
27
- "resolved": "https://registry.npmjs.org/flag-icon-css/-/flag-icon-css-4.1.7.tgz",
28
- "integrity": "sha512-AFjSU+fv98XbU0vnTQ32vcLj89UEr1MhwDFcooQv14qWJCjg9fGZzfh9BVyDhAhIOZW/pGmJmq38RqpgPaeybQ==",
29
- "deprecated": "The project has been renamed to flag-icons",
30
- "dev": true,
31
- "license": "MIT"
32
- },
33
23
  "node_modules/iso-639-1": {
34
24
  "version": "3.1.5",
35
25
  "resolved": "https://registry.npmjs.org/iso-639-1/-/iso-639-1-3.1.5.tgz",
@@ -10,7 +10,6 @@
10
10
  "license": "ISC",
11
11
  "description": "",
12
12
  "devDependencies": {
13
- "flag-icon-css": "^4.1.7"
14
13
  },
15
14
  "dependencies": {
16
15
  "country-list": "^2.4.1",
@@ -14,20 +14,12 @@ importers:
14
14
  iso-639-1:
15
15
  specifier: ^3.1.5
16
16
  version: 3.1.5
17
- devDependencies:
18
- flag-icon-css:
19
- specifier: ^4.1.7
20
- version: 4.1.7
21
17
 
22
18
  packages:
23
19
 
24
20
  country-list@2.4.1:
25
21
  resolution: {integrity: sha512-KhVV/UfUV3dSNpsWIqHTQxLpYDKPKz1UwkRjadt+YbX2PRhyCEihEoS5XgB7J7AMXpkicvl+tRHvkNI5wbji/g==}
26
22
 
27
- flag-icon-css@4.1.7:
28
- resolution: {integrity: sha512-AFjSU+fv98XbU0vnTQ32vcLj89UEr1MhwDFcooQv14qWJCjg9fGZzfh9BVyDhAhIOZW/pGmJmq38RqpgPaeybQ==}
29
- deprecated: The project has been renamed to flag-icons
30
-
31
23
  iso-639-1@3.1.5:
32
24
  resolution: {integrity: sha512-gXkz5+KN7HrG0Q5UGqSMO2qB9AsbEeyLP54kF1YrMsIxmu+g4BdB7rflReZTSTZGpfj8wywu6pfPBCylPIzGQA==}
33
25
  engines: {node: '>=6.0'}
@@ -36,6 +28,4 @@ snapshots:
36
28
 
37
29
  country-list@2.4.1: {}
38
30
 
39
- flag-icon-css@4.1.7: {}
40
-
41
31
  iso-639-1@3.1.5: {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/i18n",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "zod": "^4.3.6"
40
40
  },
41
41
  "peerDependencies": {
42
- "adminforth": "^4.0.0"
42
+ "adminforth": "^4.5.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/node": "^22.10.7",
@@ -1,16 +0,0 @@
1
- <template>
2
- <!-- only the flag-icon-<code> image class: the base flag-icon class would fight the size -->
3
- <span
4
- class="af-language-flag inline-block w-4 h-3 shrink-0 rounded-[2px] bg-cover bg-center ring-1 ring-black/10 dark:ring-white/10"
5
- :class="`flag-icon-${countryCode}`"
6
- aria-hidden="true"
7
- />
8
- </template>
9
-
10
- <script setup lang="ts">
11
- import 'flag-icon-css/css/flag-icons.min.css';
12
-
13
- defineProps<{
14
- countryCode: string,
15
- }>();
16
- </script>
@@ -1,16 +0,0 @@
1
- <template>
2
- <!-- only the flag-icon-<code> image class: the base flag-icon class would fight the size -->
3
- <span
4
- class="af-language-flag inline-block w-4 h-3 shrink-0 rounded-[2px] bg-cover bg-center ring-1 ring-black/10 dark:ring-white/10"
5
- :class="`flag-icon-${countryCode}`"
6
- aria-hidden="true"
7
- />
8
- </template>
9
-
10
- <script setup lang="ts">
11
- import 'flag-icon-css/css/flag-icons.min.css';
12
-
13
- defineProps<{
14
- countryCode: string,
15
- }>();
16
- </script>