File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/admin/components/forms/field-types/RichText/elements/relationship/Element Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
44import { useConfig } from '../../../../../../utilities/Config' ;
55import RelationshipIcon from '../../../../../../icons/Relationship' ;
66import usePayloadAPI from '../../../../../../../hooks/usePayloadAPI' ;
7+ import { getTranslation } from '../../../../../../../../utilities/getTranslation' ;
78
89import './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 >
You can’t perform that action at this time.
0 commit comments