From e4d5b8151802517b2943756fc0d09ffa95e2c4e2 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sat, 29 Jan 2022 18:21:37 +0100 Subject: chore: replace lingui functions with react-intl --- src/components/Widgets/RelatedThematics/RelatedThematics.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/components/Widgets/RelatedThematics') diff --git a/src/components/Widgets/RelatedThematics/RelatedThematics.tsx b/src/components/Widgets/RelatedThematics/RelatedThematics.tsx index afe3460..c6be3ca 100644 --- a/src/components/Widgets/RelatedThematics/RelatedThematics.tsx +++ b/src/components/Widgets/RelatedThematics/RelatedThematics.tsx @@ -1,9 +1,10 @@ import { ExpandableWidget, List } from '@components/WidgetParts'; -import { t } from '@lingui/macro'; import { ThematicPreview } from '@ts/types/taxonomies'; import Link from 'next/link'; +import { useIntl } from 'react-intl'; const RelatedThematics = ({ thematics }: { thematics: ThematicPreview[] }) => { + const intl = useIntl(); const sortedThematics = [...thematics].sort((a, b) => a.title.localeCompare(b.title) ); @@ -20,7 +21,14 @@ const RelatedThematics = ({ thematics }: { thematics: ThematicPreview[] }) => { return ( 1 ? t`Related thematics` : t`Related thematic`} + title={intl.formatMessage( + { + defaultMessage: + '{thematicsCount, plural, =0 {Related thematics} one {Related thematic} other {Related thematics}}', + description: 'RelatedThematics: widget title', + }, + { thematicsCount: thematics.length } + )} withBorders={true} > -- cgit v1.2.3