From fbd74df78e8c5a1d9c41f52c726fdc5870cbc069 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sun, 30 Jan 2022 00:00:19 +0100 Subject: chore(baseline): handle baseline translation manually I cannot use formatjs to translate the website baseline since I need an async function to load the message. If I use the getIntlInstance helper outside NextJS, webpack is complaining about fs and path. --- src/components/Layouts/Layout.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/components/Layouts/Layout.tsx') diff --git a/src/components/Layouts/Layout.tsx b/src/components/Layouts/Layout.tsx index d074b68..420b37a 100644 --- a/src/components/Layouts/Layout.tsx +++ b/src/components/Layouts/Layout.tsx @@ -17,6 +17,7 @@ const Layout = ({ isHome?: boolean; }) => { const intl = useIntl(); + const { locale } = useRouter(); const ref = useRef(null); const { asPath } = useRouter(); @@ -29,7 +30,9 @@ const Layout = ({ '@id': `${settings.url}`, '@type': 'WebSite', name: settings.name, - description: settings.baseline, + description: locale?.startsWith('en') + ? settings.baseline.en + : settings.baseline.fr, url: settings.url, author: { '@id': `${settings.url}/#branding` }, copyrightYear: Number(settings.copyright.startYear), -- cgit v1.2.3