From ee9bf1d47b45b96ed00b5f809ac528934ee36d33 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 27 Oct 2025 18:04:49 +0200 Subject: [PATCH] fix(website): incorrect lang tag --- apps/website/index.html | 2 +- apps/website/src/index.tsx | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/apps/website/index.html b/apps/website/index.html index 798ca14f9..55cb4fa6a 100644 --- a/apps/website/index.html +++ b/apps/website/index.html @@ -1,5 +1,5 @@ - + diff --git a/apps/website/src/index.tsx b/apps/website/src/index.tsx index 78dcb6556..3858165fd 100644 --- a/apps/website/src/index.tsx +++ b/apps/website/src/index.tsx @@ -52,12 +52,6 @@ export function LocaleProvider({ children }) { changeLanguage(localeId); } - useLayoutEffect(() => { - const correspondingLocale = LOCALES.find(l => l.id === localeId); - document.documentElement.lang = localeId; - document.documentElement.dir = correspondingLocale?.rtl ? "rtl" : "ltr"; - }, [ localeId ]); - return ( {children} @@ -75,6 +69,14 @@ export async function prerender(data) { // This ensures the GitHub API is not called on every page load in the client. const stargazersCount = await getRepoStargazersCount(); - return await ssr(); + const { html, links } = await ssr(); + const lang = extractLocaleFromUrl(data.url); + return { + html, + links, + head: { + lang + } + } }