feat(stats): add i18n support (#33693)
This commit is contained in:
@@ -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)} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user