import { Link } from "@solidjs/meta" import { For } from "solid-js" import { getRequestEvent } from "solid-js/web" import { config } from "~/config" import { useLanguage } from "~/context/language" import { LOCALES, route, tag } from "~/lib/language" function skip(path: string) { const evt = getRequestEvent() if (!evt) return false const key = "__locale_links_seen" const locals = evt.locals as Record const seen = locals[key] instanceof Set ? (locals[key] as Set) : new Set() locals[key] = seen if (seen.has(path)) return true seen.add(path) return false } export function LocaleLinks(props: { path: string }) { const language = useLanguage() if (skip(props.path)) return null return ( <> {(locale) => ( )} ) }