This repository has been archived by the owner on Feb 10, 2024. It is now read-only.
/
storeTranslation.ts
84 lines (66 loc) · 3.2 KB
/
storeTranslation.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Copyright (c) 2022. Heusala Group Oy <info@heusalagroup.fi>. All rights reserved.
import { ProductFeatureCategory } from "../types/product/features/ProductFeatureCategory";
import { ProductFeatureId } from "../types/product/features/ProductFeatureId";
import { ProductPriceType } from "../types/product/ProductPriceType";
import { DiskType } from "../types/product/features/DiskType";
import { ProductType } from "../types/product/ProductType";
import { SiType } from "../../types/SiType";
import { ProductPrice } from "../types/product/ProductPrice";
import { InventoryState } from "../types/inventory/InventoryState";
import { NetworkType } from "../types/product/features/NetworkType";
import { RaidType } from "../types/product/features/RaidType";
import { NetworkIpType } from "../types/product/features/NetworkIpType";
import { NetworkZone } from "../types/product/features/NetworkZone";
import { VirtualizationType } from "../types/product/features/VirtualizationType";
import { OperatingSystem } from "../types/product/features/OperatingSystem";
export function getProductFeatureCategoryTitleTranslationToken (categoryId: ProductFeatureCategory) {
return `productFeatureCategory.${categoryId}`;
}
export function getProductFeatureTitleTranslationToken (featureId: ProductFeatureId) {
return `productFeatureId.${featureId}`;
}
export function getPriceTypeTranslationToken (priceType: ProductPriceType) {
return `priceType.${priceType}`;
}
export function getDiskTypeFeatureTranslation (diskType: DiskType): string {
return `diskType.${diskType}`;
}
export function getBackupFeatureTranslation (diskType: DiskType): string {
return `backupType.${diskType}`;
}
export function getSelectPriceTypeTextForPriceType (type: ProductPriceType): string {
return `product.selectPriceType.${type}`;
}
export function getProductTypeTranslationKey (type: ProductType): string {
return `product.type.${type}`;
}
export function getCommonShortSi (type: SiType): string {
return `common.si.${type}.short`;
}
export function getSelectPriceTypeTextForPrice (item: ProductPrice): string {
return getSelectPriceTypeTextForPriceType(item.type);
}
export function getInventoryStateTranslationKey (type: InventoryState | undefined): string {
return `inventoryItem.state.${type}`;
}
export const T_COMMON_TRAFFIC_MONTHLY = "common.traffic.monthly";
export const T_COMMON_BYTE_SHORT = "common.byte.short";
export const T_COMMON_PIECE = "common.piece";
export function getNetworkTypeFeatureTranslation (networkType: NetworkType): string {
return `networkType.${networkType}`;
}
export function getNetworkZoneFeatureTranslation (networkZone: NetworkZone): string {
return `networkZone.${networkZone}`;
}
export function getNetworkIpTypeFeatureTranslation (networkIpType: NetworkIpType): string {
return `networkIpType.${networkIpType}`;
}
export function getVirtualizationTypeFeatureTranslation (value: VirtualizationType): string {
return `virtualizationType.${value}`;
}
export function getOperatingSystemFeatureTranslation (value: OperatingSystem): string {
return `operatingSystem.${value}`;
}
export function getDiskRaidTypeFeatureTranslation (raidType: RaidType): string {
return `raidType.${raidType}`;
}