Language seperation

This commit is contained in:
aronmal 2023-10-18 15:27:22 +02:00
parent 2522551cde
commit 7390bcbc01
Signed by: aronmal
GPG key ID: 816B7707426FC612
20 changed files with 279 additions and 538 deletions

View file

@ -1,19 +1,11 @@
import { Title } from "solid-start";
import Counter from "~/components/Counter";
import { createEffect } from "solid-js";
import { Title, useNavigate } from "solid-start";
export default function Home() {
return (
<main>
<Title>Hello World</Title>
<h1>Hello world!</h1>
<Counter />
<p>
Visit{" "}
<a href="https://start.solidjs.com" target="_blank">
start.solidjs.com
</a>{" "}
to learn how to build SolidStart apps.
</p>
</main>
);
const navigate = useNavigate();
createEffect(() => {
const isGerman = navigator.language.startsWith("de");
navigate(isGerman ? "/de/" : "/en/");
});
return <Title>Language detection...</Title>;
}