Skip to content

Commit ee9bf1d

Browse files
committed
fix(website): incorrect lang tag
1 parent b069fab commit ee9bf1d

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

apps/website/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="en">
2+
<html>
33
<head>
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/src/assets/favicon.ico" />

apps/website/src/index.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ export function LocaleProvider({ children }) {
5252
changeLanguage(localeId);
5353
}
5454

55-
useLayoutEffect(() => {
56-
const correspondingLocale = LOCALES.find(l => l.id === localeId);
57-
document.documentElement.lang = localeId;
58-
document.documentElement.dir = correspondingLocale?.rtl ? "rtl" : "ltr";
59-
}, [ localeId ]);
60-
6155
return (
6256
<LocaleContext.Provider value={localeId}>
6357
{children}
@@ -75,6 +69,14 @@ export async function prerender(data) {
7569
// This ensures the GitHub API is not called on every page load in the client.
7670
const stargazersCount = await getRepoStargazersCount();
7771

78-
return await ssr(<App repoStargazersCount={stargazersCount} {...data} />);
72+
const { html, links } = await ssr(<App repoStargazersCount={stargazersCount} {...data} />);
73+
const lang = extractLocaleFromUrl(data.url);
74+
return {
75+
html,
76+
links,
77+
head: {
78+
lang
79+
}
80+
}
7981
}
8082

0 commit comments

Comments
 (0)