]>
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; | |
eafe8130 TL |
85 | DEEP_SCRUB: string; |
86 | DESTROY: string; | |
87 | FLATTEN: string; | |
88 | MARK_DOWN: string; | |
89 | MARK_IN: string; | |
90 | MARK_LOST: string; | |
91 | MARK_OUT: string; | |
92 | PROTECT: string; | |
93 | PURGE: string; | |
94 | RENAME: string; | |
95 | RESTORE: string; | |
96 | REWEIGHT: string; | |
97 | ROLLBACK: string; | |
98 | SCRUB: string; | |
11fdf7f2 | 99 | SHOW: string; |
494da23a TL |
100 | TRASH: string; |
101 | UNPROTECT: string; | |
102 | RECREATE: string; | |
103 | EXPIRE: string; | |
11fdf7f2 TL |
104 | |
105 | constructor(private i18n: I18n) { | |
106 | /* Create a new item */ | |
107 | this.CREATE = this.i18n('Create'); | |
108 | ||
109 | /* Destroy an existing item */ | |
110 | this.DELETE = this.i18n('Delete'); | |
111 | ||
112 | /* Add an existing item to a container */ | |
113 | this.ADD = this.i18n('Add'); | |
114 | ||
115 | /* Remove an item from a container WITHOUT deleting it */ | |
116 | this.REMOVE = this.i18n('Remove'); | |
117 | ||
118 | /* Make changes to an existing item */ | |
119 | this.EDIT = this.i18n('Edit'); | |
120 | this.CANCEL = this.i18n('Cancel'); | |
121 | ||
122 | /* Non-standard actions */ | |
11fdf7f2 | 123 | this.CLONE = this.i18n('Clone'); |
eafe8130 TL |
124 | this.COPY = this.i18n('Copy'); |
125 | this.DEEP_SCRUB = this.i18n('Deep Scrub'); | |
126 | this.DESTROY = this.i18n('Destroy'); | |
127 | this.FLATTEN = this.i18n('Flatten'); | |
128 | this.MARK_DOWN = this.i18n('Mark Down'); | |
129 | this.MARK_IN = this.i18n('Mark In'); | |
130 | this.MARK_LOST = this.i18n('Mark Lost'); | |
131 | this.MARK_OUT = this.i18n('Mark Out'); | |
132 | this.PROTECT = this.i18n('Protect'); | |
133 | this.PURGE = this.i18n('Purge'); | |
134 | this.RENAME = this.i18n('Rename'); | |
135 | this.RESTORE = this.i18n('Restore'); | |
136 | this.REWEIGHT = this.i18n('Reweight'); | |
137 | this.ROLLBACK = this.i18n('Rollback'); | |
138 | this.SCRUB = this.i18n('Scrub'); | |
11fdf7f2 | 139 | this.SHOW = this.i18n('Show'); |
494da23a TL |
140 | this.TRASH = this.i18n('Move to Trash'); |
141 | this.UNPROTECT = this.i18n('Unprotect'); | |
142 | ||
143 | /* Prometheus wording */ | |
144 | this.RECREATE = this.i18n('Recreate'); | |
145 | this.EXPIRE = this.i18n('Expire'); | |
146 | } | |
147 | } | |
148 | ||
149 | @Injectable({ | |
150 | providedIn: 'root' | |
151 | }) | |
152 | export class SucceededActionLabelsI18n { | |
153 | /* This service is required as the i18n polyfill does not provide static | |
154 | translation | |
155 | */ | |
156 | CREATED: string; | |
157 | DELETED: string; | |
158 | ADDED: string; | |
159 | REMOVED: string; | |
160 | EDITED: string; | |
161 | CANCELED: string; | |
162 | COPIED: string; | |
163 | CLONED: string; | |
164 | SHOWED: string; | |
165 | TRASHED: string; | |
166 | UNPROTECTED: string; | |
167 | RECREATED: string; | |
168 | EXPIRED: string; | |
169 | ||
170 | constructor(private i18n: I18n) { | |
171 | /* Create a new item */ | |
172 | this.CREATED = this.i18n('Created'); | |
173 | ||
174 | /* Destroy an existing item */ | |
175 | this.DELETED = this.i18n('Deleted'); | |
176 | ||
177 | /* Add an existing item to a container */ | |
178 | this.ADDED = this.i18n('Added'); | |
179 | ||
180 | /* Remove an item from a container WITHOUT deleting it */ | |
181 | this.REMOVED = this.i18n('Removed'); | |
182 | ||
183 | /* Make changes to an existing item */ | |
184 | this.EDITED = this.i18n('Edited'); | |
185 | this.CANCELED = this.i18n('Canceled'); | |
186 | ||
187 | /* Non-standard actions */ | |
188 | this.CLONED = this.i18n('Cloned'); | |
189 | this.COPIED = this.i18n('Copied'); | |
190 | this.SHOWED = this.i18n('Showed'); | |
191 | this.TRASHED = this.i18n('Moved to Trash'); | |
192 | this.UNPROTECTED = this.i18n('Unprotected'); | |
193 | ||
194 | /* Prometheus wording */ | |
195 | this.RECREATED = this.i18n('Recreated'); | |
196 | this.EXPIRED = this.i18n('Expired'); | |
11fdf7f2 TL |
197 | } |
198 | } |