-
Notifications
You must be signed in to change notification settings - Fork 596
/
useQuickStarts.data.ts
59 lines (55 loc) · 1.71 KB
/
useQuickStarts.data.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
import { QuickStart } from '@patternfly/quickstarts';
export const quickStartSample: QuickStart = {
apiVersion: 'console.openshift.io/v1',
kind: 'ConsoleQuickStart',
metadata: { name: 'quickstart-sample' },
spec: {
displayName: 'QuickStart sample',
description: '',
icon: '',
},
};
export const anotherQuickStartSample: QuickStart = {
apiVersion: 'console.openshift.io/v1',
kind: 'ConsoleQuickStart',
metadata: { name: 'another-quickstart-sample' },
spec: {
displayName: 'QuickStart sample',
description: '',
icon: '',
},
};
const getPseudoTranslatedQuickStart = (
quickStart: QuickStart,
lang?: string,
country?: string,
): QuickStart => {
return {
...quickStart,
metadata: {
...quickStart.metadata,
name: `${quickStart.metadata.name}${lang ? `-${lang}` : ''}${country ? `-${country}` : ''}`,
labels: {
...quickStart.metadata.labels,
'console.openshift.io/name': quickStart.metadata.name,
'console.openshift.io/lang': lang,
'console.openshift.io/country': country,
},
},
spec: {
...quickStart.spec,
displayName: `${quickStart.spec.displayName}${lang ? ` ${lang}` : ''}${
country ? `-${country}` : ''
}`,
},
};
};
export const translatedQuickStarts: QuickStart[] = [
getPseudoTranslatedQuickStart(quickStartSample),
getPseudoTranslatedQuickStart(quickStartSample, 'en', 'US'),
getPseudoTranslatedQuickStart(quickStartSample, 'EN', 'CA'),
getPseudoTranslatedQuickStart(quickStartSample, 'fr', 'CA'),
getPseudoTranslatedQuickStart(quickStartSample, 'fr'),
getPseudoTranslatedQuickStart(quickStartSample, 'de', 'DE'),
getPseudoTranslatedQuickStart(quickStartSample, 'de', 'AT'),
];