bfg-common 1.4.5 → 1.4.7

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,50 +1,30 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_T_LanguageKey } from '~/lib/models/types'
3
-
4
- export function productNameLocal(
5
- localization: UI_I_Localization
6
- ): UI_I_Localization {
7
- const config = useRuntimeConfig()
8
-
9
- const productName =
10
- config.public.LOCALIZATION_CODE === 'ru'
11
- ? config.public.PRODUCT_NAME_RU
12
- : config.public.PRODUCT_NAME_EN
13
-
14
- return replaceProductNameRecursion(localization, productName)
15
- }
16
-
17
- const replaceProductNameRecursion = (
18
- localization: UI_I_Localization,
19
- productName: any
20
- ): UI_I_Localization => {
21
- for (const key of Object.keys(localization)) {
22
- let item = localization[key as UI_T_LanguageKey]
23
- // TODO move to config
24
- const localizationKeys = [
25
- 'common',
26
- 'auth',
27
- 'home',
28
- 'tasks',
29
- 'layout',
30
- 'mainNavigation',
31
- 'administration',
32
- 'inventoryConfigure',
33
- 'datastoreWizard',
34
- 'inventorySummary',
35
- 'contextMenu',
36
- 'networks',
37
- 'inventory',
38
- 'inventoryTabs',
39
- ]
40
- if (localizationKeys.includes(key)) {
41
- for (const key2 of Object.keys(item)) {
42
- item[key2] = item[key2].replaceAll('{productName}', productName)
43
- }
44
- } else {
45
- localization[key] = localization[key].replaceAll('{productName}', productName)
46
- }
47
- }
48
-
49
- return localization
50
- }
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_T_LanguageKey } from '~/lib/models/types'
3
+
4
+ export function productNameLocal(
5
+ localization: UI_I_Localization
6
+ ): UI_I_Localization {
7
+ const config = useRuntimeConfig()
8
+
9
+ const productName =
10
+ config.public.LOCALIZATION_CODE === 'ru'
11
+ ? config.public.PRODUCT_NAME_RU
12
+ : config.public.PRODUCT_NAME_EN
13
+
14
+ return replaceProductNameRecursion(localization, productName)
15
+ }
16
+
17
+ const replaceProductNameRecursion = (
18
+ localization: UI_I_Localization,
19
+ productName: any
20
+ ): UI_I_Localization => {
21
+ for (const key of Object.keys(localization)) {
22
+ let item = localization[key as UI_T_LanguageKey]
23
+
24
+ for (const key2 of Object.keys(item)) {
25
+ item[key2] = item[key2].replaceAll('{productName}', productName)
26
+ }
27
+ }
28
+
29
+ return localization
30
+ }
@@ -28,6 +28,7 @@ export interface UI_I_Localization {
28
28
  networks: UI_I_ArbitraryObject<string>
29
29
  inventory: UI_I_ArbitraryObject<string>
30
30
  inventoryTabs: UI_I_ArbitraryObject<string>
31
+ snapshots: UI_I_ArbitraryObject<string>
31
32
  }
32
33
  export interface UI_I_SendTaskParams {
33
34
  method: string
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.5",
4
+ "version": "1.4.7",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",