- Blog
+ {m.blog_title()}
{posts.length === 0 ? (
- Noch keine Beiträge.
+ {m.blog_empty()}
) : (
{posts.map((post) => (
diff --git a/src/sections/Landing.tsx b/src/sections/Landing.tsx
index 3d90dd6..956ee8b 100644
--- a/src/sections/Landing.tsx
+++ b/src/sections/Landing.tsx
@@ -1,5 +1,6 @@
import LogoQuadBG from "@/components/LogoQuadBG";
import bgDark from "@/assets/unom_Logo_5_Dark.webp";
+import { m } from "@/paraglide/messages";
export default function Landing() {
return (
@@ -11,7 +12,6 @@ export default function Landing() {
height={2160}
alt="Ein 3D Rendering des unom Logos"
/>
- {/* dim layer so the tagline sits on a calmer field */}
@@ -19,11 +19,10 @@ export default function Landing() {
- Kreative Webentwicklung aus Rottweil.
+ {m.site_tagline()}
- {/* subtle scroll hint */}
{
- return handler.fetch(req);
+ // paraglide reads the URL prefix / cookie / Accept-Language and binds the
+ // detected locale into AsyncLocalStorage for the duration of the request,
+ // so any `getLocale()` calls during SSR see the right value.
+ return paraglideMiddleware(req, () => handler.fetch(req));
},
};
diff --git a/vite.config.ts b/vite.config.ts
index 9e69546..a2c5e8d 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,3 +1,4 @@
+import { paraglideVitePlugin } from "@inlang/paraglide-js";
import tailwindcss from "@tailwindcss/vite";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
import viteReact from "@vitejs/plugin-react";
@@ -10,11 +11,26 @@ export default defineConfig({
dedupe: ["react", "react-dom"],
},
plugins: [
+ paraglideVitePlugin({
+ project: "./project.inlang",
+ outdir: "./src/paraglide",
+ // Prefer the URL prefix (so /en/* loads English), fall back to a
+ // persisted cookie, then the browser language, then the base locale (de).
+ strategy: ["url", "cookie", "preferredLanguage", "baseLocale"],
+ // German lives at /:path (unprefixed), English under /en/:path.
+ urlPatterns: [
+ {
+ pattern: "/:path(.*)?",
+ localized: [
+ ["en", "/en/:path(.*)?"],
+ ["de", "/:path(.*)?"],
+ ],
+ },
+ ],
+ }),
tailwindcss(),
tanstackStart(),
- nitro({
- preset: "bun",
- }),
+ nitro({ preset: "bun" }),
viteReact(),
],
});