Skip to content

Commit 7551631

Browse files
committed
translate some text
1 parent 58c7d02 commit 7551631

File tree

4 files changed

+38
-5
lines changed

4 files changed

+38
-5
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {useTranslation} from 'react-i18next';
2+
import {AclPermission} from './acl';
3+
4+
export default function AclHeader({aclName}: {aclName: string}) {
5+
const {t} = useTranslation();
6+
7+
const aclPermissionLabels: {[key: string]: string} = {
8+
[AclPermission.VIEW]: t('acl.permission.view', 'VIEW'),
9+
[AclPermission.SHARE]: t('acl.permission.share', 'SHARE'),
10+
[AclPermission.CREATE]: t('acl.permission.create', 'CREATE'),
11+
[AclPermission.EDIT]: t('acl.permission.edit', 'EDIT'),
12+
[AclPermission.DELETE]: t('acl.permission.delete', 'DELETE'),
13+
[AclPermission.UNDELETE]: t('acl.permission.undelete', 'UNDELETE'),
14+
[AclPermission.OPERATOR]: t('acl.permission.operator', 'OPERATOR'),
15+
[AclPermission.MASTER]: t('acl.permission.master', 'MASTER'),
16+
[AclPermission.OWNER]: t('acl.permission.owner', 'OWNER'),
17+
[AclPermission.ALL]: t('acl.permission.all', 'ALL'),
18+
};
19+
20+
return <span>{aclPermissionLabels[aclName]}</span>;
21+
}

databox/client/src/components/AttributeEntity/AttributeEntityFields.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default function AttributeEntityFields({
6969
) : null}
7070
<FormRow>
7171
<InputLabel>
72-
{t('form.attribute_entity.synonym.label', 'Synonyms')}
72+
{t('form.attribute_entity.synonyms.label', 'Synonyms')}
7373
</InputLabel>
7474
<KeyTranslationsWidget
7575
renderLocale={l => {

databox/client/src/components/Permissions/PermissionTable.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
import {Ace, UserType} from '../../types';
77
import {useTranslation} from 'react-i18next';
88
import {AclPermission, aclPermissions} from '../Acl/acl';
9+
import AclHeader from '../Acl/AclHeader';
910
import {Box} from '@mui/material';
1011
import PermissionRow from './PermissionRow';
1112
import type {TFunction} from '@alchemy/i18n';
@@ -23,15 +24,13 @@ type Props = {
2324
onMaskChange: OnMaskChange;
2425
onDelete: OnPermissionDelete;
2526
displayedPermissions?: DisplayedPermissions;
26-
permissionHelper?: PermissionHelpers;
2727
};
2828

2929
export default function PermissionTable({
3030
permissions,
3131
onMaskChange,
3232
onDelete,
3333
displayedPermissions,
34-
permissionHelper,
3534
}: Props) {
3635
const {t} = useTranslation();
3736

@@ -100,7 +99,7 @@ export default function PermissionTable({
10099
{allColumns.map(k => {
101100
return (
102101
<th key={k} className={'p'}>
103-
<span>{permissionHelper?.[k]?.label ?? k}</span>
102+
<AclHeader aclName={k} />
104103
</th>
105104
);
106105
})}

databox/client/translations/en.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,17 @@
1313
}
1414
},
1515
"permission": {
16-
"manage_collection": "Manage"
16+
"all": "ALL",
17+
"create": "CREATE",
18+
"delete": "DELETE",
19+
"edit": "EDIT",
20+
"manage_collection": "Manage",
21+
"master": "MASTER",
22+
"operator": "OPERATOR",
23+
"owner": "OWNER",
24+
"share": "SHARE",
25+
"undelete": "UNDELETE",
26+
"view": "VIEW"
1727
},
1828
"table": {
1929
"cols": {
@@ -719,6 +729,9 @@
719729
},
720730
"attribute_entity": {
721731
"synonym": {
732+
"label": "Synonym"
733+
},
734+
"synonyms": {
722735
"label": "Synonyms"
723736
},
724737
"value": {

0 commit comments

Comments
 (0)