Skip to content

Commit 91493f9

Browse files
authored
chore: richtext relationship i18n label (#1662)
1 parent 64086e8 commit 91493f9

File tree

1 file changed

+3
-2
lines changed
  • src/admin/components/forms/field-types/RichText/elements/relationship/Element

1 file changed

+3
-2
lines changed

src/admin/components/forms/field-types/RichText/elements/relationship/Element/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
44
import { useConfig } from '../../../../../../utilities/Config';
55
import RelationshipIcon from '../../../../../../icons/Relationship';
66
import usePayloadAPI from '../../../../../../../hooks/usePayloadAPI';
7+
import { getTranslation } from '../../../../../../../../utilities/getTranslation';
78

89
import './index.scss';
910

@@ -20,7 +21,7 @@ const Element = (props) => {
2021
const [relatedCollection] = useState(() => collections.find((coll) => coll.slug === relationTo));
2122
const selected = useSelected();
2223
const focused = useFocused();
23-
const { t } = useTranslation('fields');
24+
const { t, i18n } = useTranslation('fields');
2425

2526
const [{ data }] = usePayloadAPI(
2627
`${serverURL}${api}/${relatedCollection.slug}/${value?.id}`,
@@ -39,7 +40,7 @@ const Element = (props) => {
3940
<RelationshipIcon />
4041
<div className={`${baseClass}__wrap`}>
4142
<div className={`${baseClass}__label`}>
42-
{t('labelRelationship', { label: relatedCollection.labels.singular })}
43+
{t('labelRelationship', { label: getTranslation(relatedCollection.labels.singular, i18n) })}
4344
</div>
4445
<h5>{data[relatedCollection?.admin?.useAsTitle || 'id']}</h5>
4546
</div>

0 commit comments

Comments
 (0)