diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-29 19:03:59 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-29 19:03:59 +0100 |
| commit | 8fb5e4ef3ae925ebc6622711fb5c8c6147642cbc (patch) | |
| tree | 9e99137a7b64ea7993a8311a7162336a551be8b2 /src/components/Widgets/ThematicsList/ThematicsList.tsx | |
| parent | 2bae7c43764df5678fe2fc2e68be11ae95d85a41 (diff) | |
| parent | e4d5b8151802517b2943756fc0d09ffa95e2c4e2 (diff) | |
feat(i18n): replace linguijs with formatjs
Diffstat (limited to 'src/components/Widgets/ThematicsList/ThematicsList.tsx')
| -rw-r--r-- | src/components/Widgets/ThematicsList/ThematicsList.tsx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/components/Widgets/ThematicsList/ThematicsList.tsx b/src/components/Widgets/ThematicsList/ThematicsList.tsx index e5162b4..9b1f03a 100644 --- a/src/components/Widgets/ThematicsList/ThematicsList.tsx +++ b/src/components/Widgets/ThematicsList/ThematicsList.tsx @@ -1,10 +1,10 @@ import Spinner from '@components/Spinner/Spinner'; import { ExpandableWidget, List } from '@components/WidgetParts'; -import { t } from '@lingui/macro'; import { getAllThematics } from '@services/graphql/queries'; import { TitleLevel } from '@ts/types/app'; import Link from 'next/link'; import { useRouter } from 'next/router'; +import { useIntl } from 'react-intl'; import useSWR from 'swr'; const ThematicsList = ({ @@ -14,6 +14,7 @@ const ThematicsList = ({ title: string; titleLevel?: TitleLevel; }) => { + const intl = useIntl(); const router = useRouter(); const isThematic = () => router.asPath.includes('/thematique/'); const currentThematicSlug = isThematic() @@ -23,7 +24,15 @@ const ThematicsList = ({ const { data, error } = useSWR('/api/thematics', getAllThematics); const getList = () => { - if (error) return <ul>{t`Failed to load.`}</ul>; + if (error) + return ( + <ul> + {intl.formatMessage({ + defaultMessage: 'Failed to load.', + description: 'ThematicsList: failed to load text', + })} + </ul> + ); if (!data) return ( <ul> |
