feat(stats): add i18n support (#33693)
This commit is contained in:
parent
c097d51135
commit
208cd56d03
29 changed files with 4902 additions and 442 deletions
17
packages/stats/app/src/component/locale-links.tsx
Normal file
17
packages/stats/app/src/component/locale-links.tsx
Normal 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)} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue