From 9efcc0e89265099cf1007c071f2a7142c0945479 Mon Sep 17 00:00:00 2001 From: jobailla Date: Wed, 20 Oct 2021 16:39:37 +0200 Subject: [PATCH] :chart_with_upwards_trend: Ajout lang dans la balise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit L'élément n'a pas d'attribut [lang] --- mon-entreprise/source/components/utils/Meta.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mon-entreprise/source/components/utils/Meta.tsx b/mon-entreprise/source/components/utils/Meta.tsx index 0111ffa06..f2425fde7 100644 --- a/mon-entreprise/source/components/utils/Meta.tsx +++ b/mon-entreprise/source/components/utils/Meta.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next' import { useLocation } from 'react-router' type PropType = { - page: string, + page: string title: string description: string ogDescription?: string @@ -20,21 +20,26 @@ export default function Meta({ ogImage, }: PropType) { const { pathname } = useLocation() - const { t } = useTranslation() + const { t, i18n } = useTranslation() const meta = { title: t(`${page}.titre`, title) || title, description: t(`${page}.description`, description) || description, - ogDescription: ogDescription ? t(`${page}.ogDescription`, ogDescription) || ogDescription : description, + ogDescription: ogDescription + ? t(`${page}.ogDescription`, ogDescription) || ogDescription + : description, ogTitle: ogTitle ? t(`${page}.ogTitle`, ogTitle) || ogTitle : title, ogImage: ogImage ? t(`${page}.ogImage`, ogImage) || ogImage : null, } return ( - + {meta.title} - + {meta.ogImage && (