Skip to content

Commit 08c5167

Browse files
committed
some translation
1 parent c9e2c97 commit 08c5167

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

databox/client/src/components/Form/PrivacyWidget.tsx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@ const choices: {[key: string]: {label: string; helper?: string}} = {
1818
public: {label: 'Public'},
1919
};
2020

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+
2142
function getValue(value: string, workspace: boolean, auth: boolean): number {
2243
switch (value) {
2344
default:
@@ -161,8 +182,10 @@ export default function PrivacyWidget({
161182
}
162183
>
163184
<ListItemText
164-
primary={choices[k].label}
165-
secondary={choices[k].helper}
185+
primary={getChoicesTranslated(t, k).label}
186+
secondary={
187+
getChoicesTranslated(t, k)?.helper
188+
}
166189
/>
167190
</MenuItem>
168191
);

databox/client/src/components/Upload/SaveAsTemplateForm.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ export default function SaveAsTemplateForm({
8181
<SwitchWidget
8282
control={control}
8383
name={'override'}
84-
label={`Replace applied template`}
84+
label={t(
85+
'save_as_template_form.replace',
86+
`Replace applied template`
87+
)}
8588
/>
8689
</FormRow>
8790
)}

databox/client/translations/en.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@
580580
"dialog": {
581581
"intro": "Select the renditions you want to export:",
582582
"submit": "Export",
583-
"title_one": "Export {{count}} assets",
583+
"title_one": "Export {{count}} asset",
584584
"title_other": "Export {{count}} assets"
585585
}
586586
},
@@ -869,6 +869,14 @@
869869
"label": "Permissions"
870870
},
871871
"privacy": {
872+
"choices": {
873+
"helpers": {
874+
"private": "Users can request access"
875+
},
876+
"private": "Private",
877+
"public": "Public",
878+
"secret": "Secret"
879+
},
872880
"inherited": "This collection cannot be more restricted than its parent collection.",
873881
"label": "Privacy"
874882
},
@@ -1243,6 +1251,7 @@
12431251
"remember_attributes": "Remember Attributes",
12441252
"remember_privacy": "Remember Privacy",
12451253
"remember_tags": "Remember Tags",
1254+
"replace": "Replace applied template",
12461255
"save_values_as_template_for_reuse": "Save values as template for reuse",
12471256
"template_name": "Template name"
12481257
},

0 commit comments

Comments
 (0)