@@ -18,6 +18,27 @@ const choices: {[key: string]: {label: string; helper?: string}} = {
18
18
public : { label : 'Public' } ,
19
19
} ;
20
20
21
+ function getChoicesTranslated (
22
+ t : ( ...args : any ) => any ,
23
+ key : string
24
+ ) : { label : string ; helper ?: string } {
25
+ switch ( key ) {
26
+ default :
27
+ case 'secret' :
28
+ return { label : t ( 'form.privacy.choices.secret' , 'Secret' ) } ;
29
+ case 'private' :
30
+ return {
31
+ label : t ( 'form.privacy.choices.private' , 'Private' ) ,
32
+ helper : t (
33
+ 'form.privacy.choices.helpers.private' ,
34
+ 'Users can request access'
35
+ ) ,
36
+ } ;
37
+ case 'public' :
38
+ return { label : t ( 'form.privacy.choices.public' , 'Public' ) } ;
39
+ }
40
+ }
41
+
21
42
function getValue ( value : string , workspace : boolean , auth : boolean ) : number {
22
43
switch ( value ) {
23
44
default :
@@ -150,6 +171,10 @@ export default function PrivacyWidget({
150
171
onChange = { handlePChange }
151
172
>
152
173
{ Object . keys ( choices ) . map ( k => {
174
+ const choice = getChoicesTranslated ( t , k ) ;
175
+ const label = choice . label ;
176
+ const helper = choice . helper ;
177
+
153
178
return (
154
179
< MenuItem
155
180
key = { k }
@@ -161,8 +186,8 @@ export default function PrivacyWidget({
161
186
}
162
187
>
163
188
< ListItemText
164
- primary = { choices [ k ] . label }
165
- secondary = { choices [ k ] . helper }
189
+ primary = { label }
190
+ secondary = { helper }
166
191
/>
167
192
</ MenuItem >
168
193
) ;
0 commit comments