feat(stats): add i18n support (#33693)

This commit is contained in:
Adam 2026-06-25 09:50:29 -05:00 committed by GitHub
commit 208cd56d03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 4902 additions and 442 deletions

View file

@ -0,0 +1,17 @@
import { For } from "solid-js"
import { Link } from "@solidjs/meta"
import { LOCALES, localizedUrl, tag } from "../lib/language"
import { useLanguage } from "../context/language"
export function LocaleLinks(props: { path: string }) {
const language = useLanguage()
return (
<>
<Link rel="canonical" href={localizedUrl(language.locale(), props.path)} />
<For each={LOCALES}>
{(locale) => <Link rel="alternate" hreflang={tag(locale)} href={localizedUrl(locale, props.path)} />}
</For>
<Link rel="alternate" hreflang="x-default" href={localizedUrl("en", props.path)} />
</>
)
}