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/ProjectPreview/ProjectPreview.tsx | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/components/ProjectPreview/ProjectPreview.tsx') diff --git a/src/components/ProjectPreview/ProjectPreview.tsx b/src/components/ProjectPreview/ProjectPreview.tsx index cba0b02..043d945 100644 --- a/src/components/ProjectPreview/ProjectPreview.tsx +++ b/src/components/ProjectPreview/ProjectPreview.tsx @@ -1,12 +1,13 @@ -import { t } from '@lingui/macro'; import { Project } from '@ts/types/app'; import { slugify } from '@utils/helpers/slugify'; import Image from 'next/image'; import Link from 'next/link'; +import { useIntl } from 'react-intl'; import styles from './ProjectPreview.module.scss'; const ProjectPreview = ({ project }: { project: Project }) => { const { id, meta, tagline, title } = project; + const intl = useIntl(); return ( @@ -20,7 +21,13 @@ const ProjectPreview = ({ project }: { project: Project }) => { layout="fill" objectFit="contain" objectPosition="center" - alt={t`${title} picture`} + alt={intl.formatMessage( + { + defaultMessage: '{title} picture', + description: 'ProjectPreview: cover alt text', + }, + { title } + )} /> )} @@ -36,7 +43,16 @@ const ProjectPreview = ({ project }: { project: Project }) => {
{meta.technologies && (
-
{t`Technologies:`}
+
+ {intl.formatMessage( + { + defaultMessage: + '{count, plural, =0 {Technologies:} one {Technology:} other {Technologies:}}', + description: 'ProjectPreview: technologies list label', + }, + { count: meta.technologies.length } + )} +
{meta.technologies.map((techno) => (
{techno} -- cgit v1.2.3