]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | import { Injectable } from '@angular/core'; |
2 | ||
3 | import { I18n } from '@ngx-translate/i18n-polyfill'; | |
4 | ||
5 | export class AppConstants { | |
6 | public static readonly organization = 'ceph'; | |
7 | public static readonly projectName = 'Ceph Manager Dashboard'; | |
8 | public static readonly license = 'Free software (LGPL 2.1).'; | |
9 | } | |
10 | ||
11 | export enum URLVerbs { | |
12 | /* Create a new item */ | |
13 | CREATE = 'create', | |
14 | ||
15 | /* Make changes to an existing item */ | |
16 | EDIT = 'edit', | |
17 | ||
18 | /* Make changes to an existing item */ | |
19 | UPDATE = 'update', | |
20 | ||
21 | /* Remove an item from a container WITHOUT deleting it */ | |
22 | REMOVE = 'remove', | |
23 | ||
24 | /* Destroy an existing item */ | |
25 | DELETE = 'delete', | |
26 | ||
27 | /* Add an existing item to a container */ | |
28 | ADD = 'add', | |
29 | ||
30 | /* Non-standard verbs */ | |
31 | COPY = 'copy', | |
494da23a TL |
32 | CLONE = 'clone', |
33 | ||
34 | /* Prometheus wording */ | |
35 | RECREATE = 'recreate', | |
36 | EXPIRE = 'expire' | |
11fdf7f2 TL |
37 | } |
38 | ||
39 | export enum ActionLabels { | |
40 | /* Create a new item */ | |
41 | CREATE = 'Create', | |
42 | ||
43 | /* Destroy an existing item */ | |
44 | DELETE = 'Delete', | |
45 | ||
46 | /* Add an existing item to a container */ | |
47 | ADD = 'Add', | |
48 | ||
49 | /* Remove an item from a container WITHOUT deleting it */ | |
50 | REMOVE = 'Remove', | |
51 | ||
52 | /* Make changes to an existing item */ | |
53 | EDIT = 'Edit', | |
54 | ||
55 | /* */ | |
56 | CANCEL = 'Cancel', | |
57 | ||
58 | /* Non-standard actions */ | |
59 | COPY = 'Copy', | |
60 | CLONE = 'Clone', | |
61 | ||
62 | /* Read-only */ | |
494da23a TL |
63 | SHOW = 'Show', |
64 | ||
65 | /* Prometheus wording */ | |
66 | RECREATE = 'Recreate', | |
67 | EXPIRE = 'Expire' | |
11fdf7f2 TL |
68 | } |
69 | ||
70 | @Injectable({ | |
71 | providedIn: 'root' | |
72 | }) | |
73 | export class ActionLabelsI18n { | |
74 | /* This service is required as the i18n polyfill does not provide static | |
75 | translation | |
76 | */ | |
77 | CREATE: string; | |
78 | DELETE: string; | |
79 | ADD: string; | |
80 | REMOVE: string; | |
81 | EDIT: string; | |
82 | CANCEL: string; | |
83 | COPY: string; | |
84 | CLONE: string; | |
85 | SHOW: string; | |
494da23a TL |
86 | TRASH: string; |
87 | UNPROTECT: string; | |
88 | RECREATE: string; | |
89 | EXPIRE: string; | |
11fdf7f2 TL |
90 | |
91 | constructor(private i18n: I18n) { | |
92 | /* Create a new item */ | |
93 | this.CREATE = this.i18n('Create'); | |
94 | ||
95 | /* Destroy an existing item */ | |
96 | this.DELETE = this.i18n('Delete'); | |
97 | ||
98 | /* Add an existing item to a container */ | |
99 | this.ADD = this.i18n('Add'); | |
100 | ||
101 | /* Remove an item from a container WITHOUT deleting it */ | |
102 | this.REMOVE = this.i18n('Remove'); | |
103 | ||
104 | /* Make changes to an existing item */ | |
105 | this.EDIT = this.i18n('Edit'); | |
106 | this.CANCEL = this.i18n('Cancel'); | |
107 | ||
108 | /* Non-standard actions */ | |
109 | this.COPY = this.i18n('Copy'); | |
110 | this.CLONE = this.i18n('Clone'); | |
111 | ||
112 | this.SHOW = this.i18n('Show'); | |
494da23a TL |
113 | this.TRASH = this.i18n('Move to Trash'); |
114 | this.UNPROTECT = this.i18n('Unprotect'); | |
115 | ||
116 | /* Prometheus wording */ | |
117 | this.RECREATE = this.i18n('Recreate'); | |
118 | this.EXPIRE = this.i18n('Expire'); | |
119 | } | |
120 | } | |
121 | ||
122 | @Injectable({ | |
123 | providedIn: 'root' | |
124 | }) | |
125 | export class SucceededActionLabelsI18n { | |
126 | /* This service is required as the i18n polyfill does not provide static | |
127 | translation | |
128 | */ | |
129 | CREATED: string; | |
130 | DELETED: string; | |
131 | ADDED: string; | |
132 | REMOVED: string; | |
133 | EDITED: string; | |
134 | CANCELED: string; | |
135 | COPIED: string; | |
136 | CLONED: string; | |
137 | SHOWED: string; | |
138 | TRASHED: string; | |
139 | UNPROTECTED: string; | |
140 | RECREATED: string; | |
141 | EXPIRED: string; | |
142 | ||
143 | constructor(private i18n: I18n) { | |
144 | /* Create a new item */ | |
145 | this.CREATED = this.i18n('Created'); | |
146 | ||
147 | /* Destroy an existing item */ | |
148 | this.DELETED = this.i18n('Deleted'); | |
149 | ||
150 | /* Add an existing item to a container */ | |
151 | this.ADDED = this.i18n('Added'); | |
152 | ||
153 | /* Remove an item from a container WITHOUT deleting it */ | |
154 | this.REMOVED = this.i18n('Removed'); | |
155 | ||
156 | /* Make changes to an existing item */ | |
157 | this.EDITED = this.i18n('Edited'); | |
158 | this.CANCELED = this.i18n('Canceled'); | |
159 | ||
160 | /* Non-standard actions */ | |
161 | this.CLONED = this.i18n('Cloned'); | |
162 | this.COPIED = this.i18n('Copied'); | |
163 | this.SHOWED = this.i18n('Showed'); | |
164 | this.TRASHED = this.i18n('Moved to Trash'); | |
165 | this.UNPROTECTED = this.i18n('Unprotected'); | |
166 | ||
167 | /* Prometheus wording */ | |
168 | this.RECREATED = this.i18n('Recreated'); | |
169 | this.EXPIRED = this.i18n('Expired'); | |
11fdf7f2 TL |
170 | } |
171 | } |