summaryrefslogtreecommitdiffstats
path: root/src/components/Widgets/RelatedTopics
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-01-29 18:21:37 +0100
committerArmand Philippot <git@armandphilippot.com>2022-01-29 19:02:57 +0100
commite4d5b8151802517b2943756fc0d09ffa95e2c4e2 (patch)
tree9e99137a7b64ea7993a8311a7162336a551be8b2 /src/components/Widgets/RelatedTopics
parent47b854de26dea24e7838fd0804df103dee99635f (diff)
chore: replace lingui functions with react-intl
Diffstat (limited to 'src/components/Widgets/RelatedTopics')
-rw-r--r--src/components/Widgets/RelatedTopics/RelatedTopics.tsx12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/components/Widgets/RelatedTopics/RelatedTopics.tsx b/src/components/Widgets/RelatedTopics/RelatedTopics.tsx
index 178e5bc..b9699e2 100644
--- a/src/components/Widgets/RelatedTopics/RelatedTopics.tsx
+++ b/src/components/Widgets/RelatedTopics/RelatedTopics.tsx
@@ -1,9 +1,10 @@
import { ExpandableWidget, List } from '@components/WidgetParts';
-import { t } from '@lingui/macro';
import { TopicPreview } from '@ts/types/taxonomies';
import Link from 'next/link';
+import { useIntl } from 'react-intl';
const RelatedTopics = ({ topics }: { topics: TopicPreview[] }) => {
+ const intl = useIntl();
const sortedTopics = [...topics].sort((a, b) =>
a.title.localeCompare(b.title)
);
@@ -20,7 +21,14 @@ const RelatedTopics = ({ topics }: { topics: TopicPreview[] }) => {
return (
<ExpandableWidget
- title={topicsList.length > 1 ? t`Related topics` : t`Related topic`}
+ title={intl.formatMessage(
+ {
+ defaultMessage:
+ '{topicsCount, plural, =0 {Related topics} one {Related topic} other {Related topics}}',
+ description: 'RelatedTopics: widget title',
+ },
+ { topicsCount: topicsList.length }
+ )}
withBorders={true}
>
<List items={topicsList} />