setReloadKey((k) => k + 1)} />
) : null}
{status === "ready" && (!sources || sources.length === 0) ? (
) : null}
{status === "ready" && sources && sources.length > 0 && rows.length === 0 ? (
) : null}
@@ -249,7 +252,7 @@ export default function SourcesPage() {
isSorted ? "text-foreground" : "text-muted-foreground"
}`}
>
- {c.label}
+ {t(c.label)}
{isSorted ? (sort.dir === 1 ? "↑" : "↓") : "·"}
@@ -277,7 +280,7 @@ export default function SourcesPage() {
{s.market === "global" ? "Global" : s.market}
- {ACCESS_LABEL[s.access] ?? s.access}
+ {ACCESS_LABEL[s.access] ? t(ACCESS_LABEL[s.access]) : s.access}
{s.licence}
@@ -295,10 +298,10 @@ export default function SourcesPage() {
- {rows.length} källor · varje fält bär sin härkomst
+ {rows.length} {t({ en: "sources · every field carries its provenance", sv: "källor · varje fält bär sin härkomst" })}
- Licensvillkor verifieras innan användning
+ {t({ en: "Licence terms verified before use", sv: "Licensvillkor verifieras innan användning" })}
diff --git a/app/katalog/[id]/page.tsx b/app/katalog/[id]/page.tsx
index 683e2d8..2c0cf5c 100644
--- a/app/katalog/[id]/page.tsx
+++ b/app/katalog/[id]/page.tsx
@@ -4,6 +4,7 @@ import Link from "next/link";
import { useParams } from "next/navigation";
import { useCallback, useEffect, useRef, useState } from "react";
import { Header } from "@/components/header";
+import { useT } from "@/components/locale-provider";
import { DataArtifact } from "@/components/data-artifact";
import { ProvenanceBadge, CellProvenance, PROVENANCE_LEGEND } from "@/components/provenance-badge";
import { LoadingSkeleton, EmptyState, ErrorState } from "@/components/states";
@@ -104,6 +105,7 @@ function findDataset(raw: string | undefined): Dataset | undefined {
}
export default function DatasetDetailPage() {
+ const t = useT();
const { id } = useParams<{ id: string }>();
const reveal = useReveal();
@@ -145,7 +147,7 @@ export default function DatasetDetailPage() {
{status === "loading" ? (
- Katalog — laddar
+ {t({ en: "Catalog — loading", sv: "Katalog — laddar" })}
@@ -155,13 +157,13 @@ export default function DatasetDetailPage() {
{status === "error" ? (
-
+
- ← Till katalogen
+ {t({ en: "← Back to the catalog", sv: "← Till katalogen" })}
@@ -170,17 +172,20 @@ export default function DatasetDetailPage() {
{status === "empty" ? (
- ← Till katalogen
+ {t({ en: "← Back to the catalog", sv: "← Till katalogen" })}
@@ -203,6 +208,7 @@ function DatasetView({
tab: Tab;
setTab: (t: Tab) => void;
}) {
+ const t = useT();
const deposit = Math.round(d.price / 2);
const remainder = d.price - deposit;
@@ -211,7 +217,7 @@ function DatasetView({
{/* breadcrumb */}
- Katalog
+ {t({ en: "Catalog", sv: "Katalog" })}
/
{d.title}
diff --git a/app/katalog/page.tsx b/app/katalog/page.tsx
index 8fe7bb5..6d265f2 100644
--- a/app/katalog/page.tsx
+++ b/app/katalog/page.tsx
@@ -3,6 +3,7 @@
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useEffect, useMemo, useState } from "react";
+import { useT } from "@/components/locale-provider";
import { Header } from "@/components/header";
import { useReveal } from "@/hooks/use-reveal";
import { CellProvenance } from "@/components/provenance-badge";
@@ -37,6 +38,7 @@ function level(c: number): ProvLevel {
}
export default function CatalogPage() {
+ const t = useT();
const ref = useReveal
();
const router = useRouter();
const [items, setItems] = useState(null);
@@ -78,8 +80,8 @@ export default function CatalogPage() {
@@ -102,7 +104,7 @@ export default function CatalogPage() {
setQ(e.target.value)}
- placeholder="Sök dataset…"
+ placeholder={t({ en: "Search datasets…", sv: "Sök dataset…" })}
className="w-full max-w-xs border border-border bg-input px-3 py-2 font-mono text-xs outline-none focus:border-foreground sm:w-auto"
/>
@@ -113,7 +115,7 @@ export default function CatalogPage() {
) : items === null ? (
) : shown.length === 0 ? (
-
+
) : (
{shown.map((d, i) => (
@@ -121,7 +123,7 @@ export default function CatalogPage() {
{d.markets.join(" · ")}
{d.title}
-
{d.count > 0 ? new Intl.NumberFormat("sv-SE").format(d.count) + " poster" : "löpande"}
+
{d.count > 0 ? new Intl.NumberFormat("sv-SE").format(d.count) + t({ en: " records", sv: " poster" }) : t({ en: "ongoing", sv: "löpande" })}
·
{d.updated}
@@ -129,8 +131,8 @@ export default function CatalogPage() {
{formatSEK(Math.round(d.price_ore / 100))}
- Visa →
- buy(d)} className="border border-foreground px-3 py-1.5 font-mono text-[11px] uppercase tracking-[0.08em] transition-colors hover:bg-foreground hover:text-background">Beställ
+ {t({ en: "View →", sv: "Visa →" })}
+ buy(d)} className="border border-foreground px-3 py-1.5 font-mono text-[11px] uppercase tracking-[0.08em] transition-colors hover:bg-foreground hover:text-background">{t({ en: "Order", sv: "Beställ" })}
diff --git a/app/layout.tsx b/app/layout.tsx
index fb8fe11..fea9c61 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -2,6 +2,7 @@ import React from "react";
import type { Metadata } from "next";
import { Inter, JetBrains_Mono } from "next/font/google";
import { Analytics } from "@vercel/analytics/next";
+import { LocaleProvider } from "@/components/locale-provider";
import "./globals.css";
const inter = Inter({ subsets: ["latin"], variable: "--font-inter" });
@@ -16,9 +17,9 @@ export const metadata: Metadata = {
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
return (
-
+
- {children}
+
{children}
diff --git a/app/order/[id]/page.tsx b/app/order/[id]/page.tsx
index 68339ad..8b10199 100644
--- a/app/order/[id]/page.tsx
+++ b/app/order/[id]/page.tsx
@@ -4,15 +4,16 @@ import Link from "next/link";
import { useParams } from "next/navigation";
import { useEffect, useRef, useState } from "react";
import { OrderStepper } from "@/components/order-stepper";
+import { useT } from "@/components/locale-provider";
import { useReveal } from "@/hooks/use-reveal";
import { getLocalOrder } from "@/lib/order-client";
-const STAGES = [
- { key: "source", title: "Källracing", meta: "GLEIF · Brreg · CVR · PRH" },
- { key: "extract", title: "Extraktion & OCR", meta: "register-API · dokument" },
- { key: "structure", title: "Strukturering & matchning", meta: "NER · entity resolution · LEI-länk" },
- { key: "enrich", title: "Berikning & fusion", meta: "multi-source agreement" },
- { key: "quality", title: "Kvalitetskontroll", meta: "expectations · dedup · tröskel" },
+const STAGES: { key: string; title: { en: string; sv: string }; meta: string }[] = [
+ { key: "source", title: { en: "Source race", sv: "Källracing" }, meta: "GLEIF · Brreg · CVR · PRH" },
+ { key: "extract", title: { en: "Extraction & OCR", sv: "Extraktion & OCR" }, meta: "register-API · dokument" },
+ { key: "structure", title: { en: "Structuring & matching", sv: "Strukturering & matchning" }, meta: "NER · entity resolution · LEI-länk" },
+ { key: "enrich", title: { en: "Enrichment & fusion", sv: "Berikning & fusion" }, meta: "multi-source agreement" },
+ { key: "quality", title: { en: "Quality control", sv: "Kvalitetskontroll" }, meta: "expectations · dedup · tröskel" },
];
const MARKET_KEYS = [
{ code: "SE", speed: 1.0 },
@@ -26,6 +27,7 @@ function prefersReduced() {
}
export default function ProductionPage() {
+ const t = useT();
const { id } = useParams<{ id: string }>();
const reveal = useReveal
();
const [running, setRunning] = useState(false);
@@ -58,7 +60,7 @@ export default function ProductionPage() {
setConf(94);
setDone(true);
setRunning(false);
- setFeed((f) => [{ t: stamp(), msg: "Levererad. 94 % konfidens. 4 980 poster.", kind: "ok" }, ...f]);
+ setFeed((f) => [{ t: stamp(), msg: t({ en: "Delivered. 94% confidence. 4,980 records.", sv: "Levererad. 94 % konfidens. 4 980 poster." }), kind: "ok" }, ...f]);
};
const stamp = () => {
@@ -73,7 +75,7 @@ export default function ProductionPage() {
return;
}
setRunning(true);
- setFeed([{ t: "00:00", msg: `Order ${id}. Depå mottagen.`, kind: "run" }]);
+ setFeed([{ t: "00:00", msg: t({ en: `Order ${id}. Deposit received.`, sv: `Order ${id}. Depå mottagen.` }), kind: "run" }]);
timer.current = setInterval(() => {
tick.current += 1;
setProgress((prev) => {
@@ -82,7 +84,7 @@ export default function ProductionPage() {
if (i === -1) return prev;
next[i] = Math.min(100, next[i] + 8 + Math.random() * 10);
if (next[i] >= 100 && i < STAGES.length) {
- setFeed((f) => [{ t: stamp(), msg: `${STAGES[i].title}. Klar.`, kind: "ok" }, ...f].slice(0, 12));
+ setFeed((f) => [{ t: stamp(), msg: t({ en: `${STAGES[i].title.en}. Done.`, sv: `${STAGES[i].title.sv}. Klar.` }), kind: "ok" }, ...f].slice(0, 12));
}
return next;
});
@@ -99,7 +101,7 @@ export default function ProductionPage() {
useEffect(() => () => { if (timer.current) clearInterval(timer.current); }, []);
const overall = Math.round(progress.reduce((a, b) => a + b, 0) / STAGES.length);
- const status = done ? "Levererad" : running ? `${overall} %` : "Väntar";
+ const status = done ? t({ en: "Delivered", sv: "Levererad" }) : running ? `${overall} %` : t({ en: "Waiting", sv: "Väntar" });
return (
@@ -115,15 +117,15 @@ export default function ProductionPage() {
03
- Steg 03 — Produktion
+ {t({ en: "Step 03 — Production", sv: "Steg 03 — Produktion" })}
- Se det hända.
+ {t({ en: "Watch it happen.", sv: "Se det hända." })}
{order
- ? `${order.markets.join(" · ") || "—"} · ${new Intl.NumberFormat("sv-SE").format(order.volume)} poster`
- : "Live. Källa för källa."}
+ ? `${order.markets.join(" · ") || "—"} · ${new Intl.NumberFormat("sv-SE").format(order.volume)} ${t({ en: "records", sv: "poster" })}`
+ : t({ en: "Live. Source by source.", sv: "Live. Källa för källa." })}
@@ -138,18 +140,18 @@ export default function ProductionPage() {
{done ? "✓" : running ? "●" : "▸"}
- {done ? "Klar" : running ? "Kör" : "Starta"}
+ {done ? t({ en: "Done", sv: "Klar" }) : running ? t({ en: "Running", sv: "Kör" }) : t({ en: "Start", sv: "Starta" })}
- Order {id}
+ {t({ en: "Order", sv: "Order" })} {id}
- Status
+ {t({ en: "Status", sv: "Status" })}
{status}
- ETA
- ≈ 4 dgr
+ {t({ en: "ETA", sv: "ETA" })}
+ {t({ en: "≈ 4 days", sv: "≈ 4 dgr" })}
@@ -177,7 +179,7 @@ export default function ProductionPage() {
{String(i + 1).padStart(2, "0")}
-
{s.title}
+
{t(s.title)}
{p}%
@@ -201,15 +203,15 @@ export default function ProductionPage() {
{/* confidence gauge */}
-
+
- Konfidens — levererbart
+ {t({ en: "Confidence — deliverable", sv: "Konfidens — levererbart" })}
{/* per market */}
-
Per marknad
+
{t({ en: "Per market", sv: "Per marknad" })}
{MARKET_KEYS.map((m, i) => (
@@ -227,9 +229,9 @@ export default function ProductionPage() {
{/* activity */}
-
Aktivitet
+
{t({ en: "Activity", sv: "Aktivitet" })}
- {feed.length === 0 ?
Inget än. : null}
+ {feed.length === 0 ?
{t({ en: "Nothing yet.", sv: "Inget än." })} : null}
{feed.map((f, i) => (
{f.t}
@@ -247,7 +249,7 @@ export default function ProductionPage() {
href={`/order/${id}/validera`}
className="group inline-flex items-center gap-3 bg-foreground px-7 py-4 font-mono text-[12px] uppercase tracking-[0.12em] text-background transition-colors hover:bg-[var(--accent-red)]"
>
- Granska resultatet
+ {t({ en: "Review the result", sv: "Granska resultatet" })}
→
@@ -257,7 +259,7 @@ export default function ProductionPage() {
);
}
-function ConfidenceRing({ value }: { value: number }) {
+function ConfidenceRing({ value, unitLabel }: { value: number; unitLabel: string }) {
const r = 52;
const c = 2 * Math.PI * r;
const off = c - (value / 100) * c;
@@ -273,7 +275,7 @@ function ConfidenceRing({ value }: { value: number }) {
{Math.round(value)}
- PROCENT
+ {unitLabel}
);
diff --git a/app/order/[id]/validera/page.tsx b/app/order/[id]/validera/page.tsx
index 4be3d74..1cb378f 100644
--- a/app/order/[id]/validera/page.tsx
+++ b/app/order/[id]/validera/page.tsx
@@ -3,6 +3,7 @@
import { useParams } from "next/navigation";
import { useState } from "react";
import { OrderStepper } from "@/components/order-stepper";
+import { useT } from "@/components/locale-provider";
import { useReveal } from "@/hooks/use-reveal";
import { CellProvenance, ProvenanceBadge, PROVENANCE_LEGEND } from "@/components/provenance-badge";
import { MARKETS, SAMPLE_ROWS, formatSEK } from "@/lib/data";
diff --git a/app/portal/files/page.tsx b/app/portal/files/page.tsx
index 14ae918..c00f00f 100644
--- a/app/portal/files/page.tsx
+++ b/app/portal/files/page.tsx
@@ -1,6 +1,7 @@
"use client";
import { useCallback, useEffect, useRef, useState } from "react";
+import { useT } from "@/components/locale-provider";
import { PortalShell } from "@/components/portal-shell";
import { LoadingSkeleton, EmptyState, ErrorState } from "@/components/states";
import { formatSEK } from "@/lib/data";
@@ -34,6 +35,7 @@ function fmtBytes(b: number): string {
}
export default function FilesPage() {
+ const t = useT();
const [files, setFiles] = useState
(null);
const [error, setError] = useState(false);
const [dragging, setDragging] = useState(false);
@@ -84,12 +86,12 @@ export default function FilesPage() {
function openPicker() { inputRef.current?.click(); }
return (
-
+
{/* dropzone */}
{ if (e.key === "Enter" || e.key === " ") { e.preventDefault(); openPicker(); } }}
onDragOver={(e) => { e.preventDefault(); setDragging(true); }}
@@ -107,11 +109,15 @@ export default function FilesPage() {
style={{ backgroundColor: dragging ? "var(--accent-red)" : "var(--foreground)" }}
/>
- {busy ? "laddar upp…" : dragging ? "släpp här" : "dra hit · eller klicka"}
+ {busy
+ ? t({ en: "uploading…", sv: "laddar upp…" })
+ : dragging
+ ? t({ en: "drop here", sv: "släpp här" })
+ : t({ en: "drag here · or click", sv: "dra hit · eller klicka" })}
- CSV, Excel, listor.
- Matas in i matchning & berikning.
+ {t({ en: "CSV, Excel, lists.", sv: "CSV, Excel, listor." })}
+ {t({ en: "Fed straight into matching & enrichment.", sv: "Matas in i matchning & berikning." })}
- Filuppladdning aktiveras när lagring kopplas.
+ {t({ en: "File upload activates once storage is connected.", sv: "Filuppladdning aktiveras när lagring kopplas." })}
) : null}
@@ -139,13 +145,13 @@ export default function FilesPage() {
) : files.length === 0 ? (
) : (
- Fil Typ Storlek Status
+ {t({ en: "File", sv: "Fil" })} {t({ en: "Type", sv: "Typ" })} {t({ en: "Size", sv: "Storlek" })} {t({ en: "Status", sv: "Status" })}
{files.map((f) => (
@@ -167,7 +173,7 @@ export default function FilesPage() {
- Uppladdat dedupliceras mot din fil · ingen kostnad förrän du beställer{files && files.length ? ` · ${formatSEK(0)} hittills` : ""}
+ {t({ en: "Uploads are deduplicated against your file · no cost until you order", sv: "Uppladdat dedupliceras mot din fil · ingen kostnad förrän du beställer" })}{files && files.length ? ` · ${formatSEK(0)} ${t({ en: "so far", sv: "hittills" })}` : ""}
);
diff --git a/app/portal/page.tsx b/app/portal/page.tsx
index 9bf1cfa..4239417 100644
--- a/app/portal/page.tsx
+++ b/app/portal/page.tsx
@@ -4,6 +4,7 @@ import Link from "next/link";
import { useCallback, useEffect, useState } from "react";
import { Header } from "@/components/header";
import { EmptyState, ErrorState, LoadingSkeleton } from "@/components/states";
+import { useT } from "@/components/locale-provider";
import { formatSEK } from "@/lib/data";
import { mergeOrders, getLocalOrders } from "@/lib/order-client";
@@ -47,6 +48,7 @@ function shortId(id: string) {
}
export default function PortalPage() {
+ const t = useT();
const [orders, setOrders] = useState
(null);
const [error, setError] = useState(false);
diff --git a/app/portal/subscriptions/page.tsx b/app/portal/subscriptions/page.tsx
index e28967d..33cc356 100644
--- a/app/portal/subscriptions/page.tsx
+++ b/app/portal/subscriptions/page.tsx
@@ -1,6 +1,7 @@
"use client";
import { useCallback, useEffect, useState } from "react";
+import { useT } from "@/components/locale-provider";
import { PortalShell, StatusPill } from "@/components/portal-shell";
import { LoadingSkeleton, EmptyState, ErrorState } from "@/components/states";
diff --git a/app/tjanster/page.tsx b/app/tjanster/page.tsx
index 55082df..245d6c0 100644
--- a/app/tjanster/page.tsx
+++ b/app/tjanster/page.tsx
@@ -4,16 +4,18 @@ import Link from "next/link";
import { useReveal } from "@/hooks/use-reveal";
import { SERVICES, FLOW_LABEL, type Flow } from "@/lib/services";
import { Header } from "@/components/header";
+import { useT } from "@/components/locale-provider";
const ORDER: Flow[] = ["custom", "catalog", "subscription"];
-function ctaFor(flow: Flow, id: string): { href: string; label: string } {
- if (flow === "catalog") return { href: "/katalog", label: "Bläddra katalog" };
- if (flow === "subscription") return { href: `/bestall/beskriv?service=${id}`, label: "Konfigurera flöde" };
- return { href: `/bestall/beskriv?service=${id}`, label: "Beskriv behovet" };
+function ctaFor(flow: Flow, id: string): { href: string; label: { en: string; sv: string } } {
+ if (flow === "catalog") return { href: "/katalog", label: { en: "Browse catalog", sv: "Bläddra katalog" } };
+ if (flow === "subscription") return { href: `/bestall/beskriv?service=${id}`, label: { en: "Configure flow", sv: "Konfigurera flöde" } };
+ return { href: `/bestall/beskriv?service=${id}`, label: { en: "Describe your need", sv: "Beskriv behovet" } };
}
export default function ServicesPage() {
+ const t = useT();
const ref = useReveal();
return (
@@ -23,12 +25,12 @@ export default function ServicesPage() {
∑
- Tjänster
+ {t({ en: "Services", sv: "Tjänster" })}
- All data. På beställning.
+ {t({ en: "All your data. On demand.", sv: "All data. På beställning." })}
- Skrapning. Mappning. Normalisering. Konsolidering till CRM/ERP. ML. BI. Allt med härkomst per fält.
+ {t({ en: "Scraping. Mapping. Normalization. Consolidation into CRM/ERP. ML. BI. All with provenance for every field.", sv: "Skrapning. Mappning. Normalisering. Konsolidering till CRM/ERP. ML. BI. Allt med härkomst per fält." })}
@@ -50,7 +52,7 @@ export default function ServicesPage() {
{s.covers}
→ {s.deliverable}
- {cta.label}
+ {t(cta.label)}
→
@@ -62,9 +64,9 @@ export default function ServicesPage() {
})}
-
Vet du inte vad du behöver?
+
{t({ en: "Not sure what you need?", sv: "Vet du inte vad du behöver?" })}
- Beskriv behovet →
+ {t({ en: "Describe your need", sv: "Beskriv behovet" })} →
diff --git a/components/header.tsx b/components/header.tsx
index 4e78056..8aa8095 100644
--- a/components/header.tsx
+++ b/components/header.tsx
@@ -2,13 +2,15 @@
import Link from "next/link";
import { useEffect, useState } from "react";
+import { useT } from "@/components/locale-provider";
+import { LocaleSwitcher } from "@/components/locale-switcher";
-const NAV = [
- { label: "Tjänster", href: "/tjanster" },
- { label: "Katalog", href: "/katalog" },
- { label: "Så funkar det", href: "/#motorn" },
- { label: "Källor", href: "/kallor" },
- { label: "Priser", href: "/#priser" },
+const NAV: { label: { en: string; sv: string }; href: string }[] = [
+ { label: { en: "Services", sv: "Tjänster" }, href: "/tjanster" },
+ { label: { en: "Catalog", sv: "Katalog" }, href: "/katalog" },
+ { label: { en: "How it works", sv: "Så funkar det" }, href: "/#motorn" },
+ { label: { en: "Sources", sv: "Källor" }, href: "/kallor" },
+ { label: { en: "Pricing", sv: "Priser" }, href: "/#priser" },
];
function Wordmark() {
@@ -19,14 +21,13 @@ function Wordmark() {
className="inline-block h-[5px] w-[5px] translate-y-[-2px] transition-transform duration-300 group-hover:translate-y-[-4px]"
style={{ backgroundColor: "var(--accent-red)" }}
/>
-
- your data
-
+
your data
);
}
export function Header() {
+ const t = useT();
const [scrolled, setScrolled] = useState(false);
const [open, setOpen] = useState(false);
@@ -51,37 +52,32 @@ export function Header() {
{NAV.map((n) => (
- {n.label}
-
+ {t(n.label)}
+
))}
-
-
- Logga in
+
+
+
+ {t({ en: "Sign in", sv: "Logga in" })}
- Beställ
+ {t({ en: "Order", sv: "Beställ" })}
→
setOpen((v) => !v)}
className="flex h-9 w-9 items-center justify-center border border-border transition-colors hover:border-foreground md:hidden"
>
@@ -94,25 +90,21 @@ export function Header() {
{NAV.map((n, i) => (
setOpen(false)}
className="flex items-baseline justify-between border-b border-border py-4 font-mono text-[12px] uppercase tracking-[0.12em] text-muted-foreground transition-colors hover:text-foreground"
>
-
{n.label}
-
- {String(i + 1).padStart(2, "0")}
-
+
{t(n.label)}
+
{String(i + 1).padStart(2, "0")}
))}
-
setOpen(false)}
- className="mt-4 flex items-center justify-center gap-2 bg-foreground px-5 py-3.5 font-mono text-[12px] uppercase tracking-[0.12em] text-background"
- >
- Beställ
-
→
-
+
+
+ setOpen(false)} className="bg-foreground px-5 py-3 font-mono text-[12px] uppercase tracking-[0.12em] text-background">
+ {t({ en: "Order", sv: "Beställ" })} →
+
+
) : null}
diff --git a/components/locale-provider.tsx b/components/locale-provider.tsx
new file mode 100644
index 0000000..691b6bd
--- /dev/null
+++ b/components/locale-provider.tsx
@@ -0,0 +1,45 @@
+"use client";
+
+import { createContext, useContext, useEffect, useState } from "react";
+
+export type Locale = "en" | "sv";
+
+const Ctx = createContext<{ locale: Locale; setLocale: (l: Locale) => void }>({
+ locale: "en",
+ setLocale: () => {},
+});
+
+export function LocaleProvider({ children }: { children: React.ReactNode }) {
+ // English is the base; Swedish is opt-in and persisted.
+ const [locale, setLocaleState] = useState
("en");
+
+ useEffect(() => {
+ try {
+ const saved = localStorage.getItem("0pt-locale") as Locale | null;
+ if (saved === "en" || saved === "sv") {
+ setLocaleState(saved);
+ document.documentElement.lang = saved;
+ }
+ } catch {}
+ }, []);
+
+ const setLocale = (l: Locale) => {
+ setLocaleState(l);
+ try { localStorage.setItem("0pt-locale", l); } catch {}
+ document.documentElement.lang = l;
+ };
+
+ return {children} ;
+}
+
+export function useLocale() {
+ return useContext(Ctx);
+}
+
+/** Pick a localized value: const s = useT()({ en: "...", sv: "..." }) */
+export function useT() {
+ const { locale } = useLocale();
+ return function pick(map: { en: T; sv: T }): T {
+ return map[locale];
+ };
+}
diff --git a/components/locale-switcher.tsx b/components/locale-switcher.tsx
new file mode 100644
index 0000000..533fbcf
--- /dev/null
+++ b/components/locale-switcher.tsx
@@ -0,0 +1,30 @@
+"use client";
+
+import { useLocale, type Locale } from "@/components/locale-provider";
+
+const LOCALES: Locale[] = ["en", "sv"];
+
+export function LocaleSwitcher() {
+ const { locale, setLocale } = useLocale();
+ return (
+
+ {LOCALES.map((l, i) => (
+
+ setLocale(l)}
+ aria-pressed={locale === l}
+ className="px-1 py-0.5 transition-colors"
+ style={{
+ color: locale === l ? "var(--foreground)" : "var(--muted-foreground)",
+ borderBottom: locale === l ? "1px solid var(--accent-red)" : "1px solid transparent",
+ }}
+ >
+ {l}
+
+ {i === 0 ? / : null}
+
+ ))}
+
+ );
+}
diff --git a/components/order-stepper.tsx b/components/order-stepper.tsx
index a913b9b..0532f66 100644
--- a/components/order-stepper.tsx
+++ b/components/order-stepper.tsx
@@ -1,17 +1,21 @@
+"use client";
+
import Link from "next/link";
+import { useT } from "@/components/locale-provider";
const STEPS = [
- { n: 1, label: "Konfigurera", href: "/bestall" },
- { n: 2, label: "Förskott", href: "/bestall/forskott" },
- { n: 3, label: "Produktion", href: null },
- { n: 4, label: "Validera", href: null },
+ { n: 1, label: { en: "Configure", sv: "Konfigurera" }, href: "/bestall" },
+ { n: 2, label: { en: "Deposit", sv: "Förskott" }, href: "/bestall/forskott" },
+ { n: 3, label: { en: "Production", sv: "Produktion" }, href: null },
+ { n: 4, label: { en: "Validate", sv: "Validera" }, href: null },
] as const;
/** Mono 4-step indicator. Active step carries the single red marker. */
export function OrderStepper({ active }: { active: 1 | 2 | 3 | 4 }) {
+ const t = useT();
return (
{STEPS.map((s, i) => {
@@ -33,7 +37,7 @@ export function OrderStepper({ active }: { active: 1 | 2 | 3 | 4 }) {
className="font-mono text-[11px] uppercase tracking-[0.12em]"
style={{ color: isActive ? "var(--foreground)" : "var(--muted-foreground)" }}
>
- {s.label}
+ {t(s.label)}
);
diff --git a/components/portal-shell.tsx b/components/portal-shell.tsx
index 68ca820..a8d6855 100644
--- a/components/portal-shell.tsx
+++ b/components/portal-shell.tsx
@@ -3,23 +3,24 @@
import Link from "next/link";
import { usePathname } from "next/navigation";
import { useEffect, useState } from "react";
+import { useT } from "@/components/locale-provider";
-export type NavItem = { label: string; href: string };
+export type NavItem = { label: { en: string; sv: string }; href: string };
const CUSTOMER_NAV: NavItem[] = [
- { label: "Översikt", href: "/portal" },
- { label: "Prenumerationer", href: "/portal/subscriptions" },
- { label: "Filer", href: "/portal/files" },
- { label: "Integrationer", href: "/portal/integrationer" },
- { label: "Inställningar", href: "/portal/settings" },
+ { label: { en: "Overview", sv: "Översikt" }, href: "/portal" },
+ { label: { en: "Subscriptions", sv: "Prenumerationer" }, href: "/portal/subscriptions" },
+ { label: { en: "Files", sv: "Filer" }, href: "/portal/files" },
+ { label: { en: "Integrations", sv: "Integrationer" }, href: "/portal/integrationer" },
+ { label: { en: "Settings", sv: "Inställningar" }, href: "/portal/settings" },
];
const ADMIN_NAV: NavItem[] = [
- { label: "Översikt", href: "/admin" },
- { label: "Källor", href: "/admin/sources" },
- { label: "Jobb", href: "/admin/jobs" },
- { label: "Verktyg", href: "/admin/verktyg" },
- { label: "Kunder", href: "/admin/customers" },
+ { label: { en: "Overview", sv: "Översikt" }, href: "/admin" },
+ { label: { en: "Sources", sv: "Källor" }, href: "/admin/sources" },
+ { label: { en: "Jobs", sv: "Jobb" }, href: "/admin/jobs" },
+ { label: { en: "Tools", sv: "Verktyg" }, href: "/admin/verktyg" },
+ { label: { en: "Customers", sv: "Kunder" }, href: "/admin/customers" },
];
export function PortalShell({
@@ -31,6 +32,7 @@ export function PortalShell({
title: string;
children: React.ReactNode;
}) {
+ const t = useT();
const pathname = usePathname();
const nav = variant === "admin" ? ADMIN_NAV : CUSTOMER_NAV;
const [email, setEmail] = useState(null);
@@ -63,12 +65,12 @@ export function PortalShell({
<>
{email}
- Logga ut
+ {t({ en: "Log out", sv: "Logga ut" })}
>
) : (
- Logga in
+ {t({ en: "Log in", sv: "Logga in" })}
)}
@@ -90,17 +92,17 @@ export function PortalShell({
color: active ? "var(--foreground)" : "var(--muted-foreground)",
}}
>
- {n.label}
+ {t(n.label)}
);
})}
{variant === "customer" ? (
- Ny beställning
+ {t({ en: "New order", sv: "Ny beställning" })}
) : (
- ← Kundvy
+ {t({ en: "← Customer view", sv: "← Kundvy" })}
)}
diff --git a/components/sections/collection-section.tsx b/components/sections/collection-section.tsx
index 1f2ff39..13bd99d 100644
--- a/components/sections/collection-section.tsx
+++ b/components/sections/collection-section.tsx
@@ -1,35 +1,37 @@
"use client";
import { useReveal } from "@/hooks/use-reveal";
+import { useT } from "@/components/locale-provider";
import { MARKETS } from "@/lib/data";
-const STATS = [
- ["4 980", "poster i exempel"],
- ["20", "utelämnade. Ej gissade"],
- ["3,2", "källor per fält"],
+const STATS: [string, { en: string; sv: string }][] = [
+ ["4 980", { en: "records in the sample", sv: "poster i exempel" }],
+ ["20", { en: "omitted. Never guessed", sv: "utelämnade. Ej gissade" }],
+ ["3,2", { en: "sources per field", sv: "källor per fält" }],
];
export function CollectionSection() {
+ const t = useT();
const ref = useReveal
();
const liveCount = MARKETS.filter((m) => m.live).length;
return (
-
04 — Täckning
+
{t({ en: "04 — Coverage", sv: "04 — Täckning" })}
{liveCount}/{MARKETS.length} live
- Tjugo marknader.
+ {t({ en: "Twenty markets.", sv: "Tjugo marknader." })}
- En modell.
+ {t({ en: "One model.", sv: "En modell." })}
- Samma motor. Samma bevis.
+ {t({ en: "Same engine. Same proof.", sv: "Samma motor. Samma bevis." })}
- Varje land.
+ {t({ en: "Every country.", sv: "Varje land." })}
@@ -45,7 +47,7 @@ export function CollectionSection() {
{String(i + 1).padStart(2, "0")}
- {m.live ? `${m.coverage}%` : "kommande"}
+ {m.live ? `${m.coverage}%` : t({ en: "coming", sv: "kommande" })}
{STATS.map(([n, l], i) => (
-
diff --git a/components/sections/editorial-section.tsx b/components/sections/editorial-section.tsx
index 4ffc9f5..c391310 100644
--- a/components/sections/editorial-section.tsx
+++ b/components/sections/editorial-section.tsx
@@ -1,9 +1,11 @@
"use client";
import { useReveal } from "@/hooks/use-reveal";
+import { useT } from "@/components/locale-provider";
export function EditorialSection() {
const ref = useReveal
();
+ const t = useT();
return (
{/* Oversized faint numeral — graphic texture */}
@@ -17,19 +19,19 @@ export function EditorialSection() {
{/* Hairline + section index */}
- Manifest
+ {t({ en: "Manifesto", sv: "Manifest" })}
- Data du kan{" "}
+ {t({ en: "Data you can", sv: "Data du kan" })}{" "}
- stå för
+ {t({ en: "stand behind", sv: "stå för" })}
.
- Inte se rätt ut.
+ {t({ en: "Not just look right.", sv: "Inte se rätt ut." })}
diff --git a/components/sections/featured-products-section.tsx b/components/sections/featured-products-section.tsx
index 13a2791..85ba4f0 100644
--- a/components/sections/featured-products-section.tsx
+++ b/components/sections/featured-products-section.tsx
@@ -3,6 +3,7 @@
import Link from "next/link";
import { useState } from "react";
import { useReveal } from "@/hooks/use-reveal";
+import { useT } from "@/components/locale-provider";
import { ProvenanceBadge } from "@/components/provenance-badge";
import type { ProvLevel } from "@/lib/data";
@@ -31,6 +32,7 @@ const DATASETS: Dataset[] = [
export function FeaturedProductsSection() {
const ref = useReveal();
+ const t = useT();
const [filter, setFilter] = useState("Alla");
const shown = DATASETS.filter((d) => filter === "Alla" || d.cat === filter);
@@ -47,11 +49,11 @@ export function FeaturedProductsSection() {
-
02 / Katalog
+
{t({ en: "02 / Catalog", sv: "02 / Katalog" })}
- Färdiga dataset.
+ {t({ en: "Ready-made datasets.", sv: "Färdiga dataset." })}
- Redo att leverera.
+ {t({ en: "Ready to ship.", sv: "Redo att leverera." })}
@@ -93,10 +95,10 @@ export function FeaturedProductsSection() {
- Visa urval →
+ {t({ en: "View sample →", sv: "Visa urval →" })}
- Beställ
+ {t({ en: "Order", sv: "Beställ" })}
diff --git a/components/sections/footer-section.tsx b/components/sections/footer-section.tsx
index b049220..e39fd7b 100644
--- a/components/sections/footer-section.tsx
+++ b/components/sections/footer-section.tsx
@@ -2,6 +2,7 @@
import Link from "next/link";
import { useReveal } from "@/hooks/use-reveal";
+import { useT } from "@/components/locale-provider";
const COLUMNS: { head: string; links: { label: string; href: string }[] }[] = [
{ head: "Produkt", links: [{ label: "Katalog", href: "/#katalog" }, { label: "Beställ", href: "/bestall" }, { label: "Priser", href: "/#priser" }, { label: "API", href: "/bestall" }] },
@@ -12,6 +13,7 @@ const COLUMNS: { head: string; links: { label: string; href: string }[] }[] = [
export function FooterSection() {
const ref = useReveal
();
+ const t = useT();
return (
@@ -23,8 +25,8 @@ export function FooterSection() {
- På beställning. Härkomst per fält.
- Inget gissat.
+ {t({ en: "On demand. Provenance per field.", sv: "På beställning. Härkomst per fält." })}
+ {t({ en: "Nothing guessed.", sv: "Inget gissat." })}
{COLUMNS.map((c, i) => (
@@ -54,7 +56,7 @@ export function FooterSection() {
0pt
- Beställ. Betala hälften. Validera.
+ {t({ en: "Order.", sv: "Beställ." })} {t({ en: "Pay half.", sv: "Betala hälften." })} {t({ en: "Validate.", sv: "Validera." })}
diff --git a/components/sections/gallery-section.tsx b/components/sections/gallery-section.tsx
index 9e66c91..93b31de 100644
--- a/components/sections/gallery-section.tsx
+++ b/components/sections/gallery-section.tsx
@@ -1,6 +1,7 @@
"use client";
import { useReveal } from "@/hooks/use-reveal";
+import { useT } from "@/components/locale-provider";
import { DataArtifact } from "@/components/data-artifact";
const TILES: { variant: "table" | "map" | "schema" | "chart" | "grid"; index: string; title: string; line: string }[] = [
@@ -13,18 +14,19 @@ const TILES: { variant: "table" | "map" | "schema" | "chart" | "grid"; index: st
export function GallerySection() {
const ref = useReveal();
+ const tr = useT();
return (
-
— Visualiseringar
+
{tr({ en: "— Visualizations", sv: "— Visualiseringar" })}
- Se den.
+ {tr({ en: "See it.", sv: "Se den." })}
- Tabell. Karta. Schema. Graf. Du väljer.
+ {tr({ en: "Table. Map. Schema. Chart. Your call.", sv: "Tabell. Karta. Schema. Graf. Du väljer." })}
diff --git a/components/sections/hero-section.tsx b/components/sections/hero-section.tsx
index 7e59c1e..635f322 100644
--- a/components/sections/hero-section.tsx
+++ b/components/sections/hero-section.tsx
@@ -2,6 +2,7 @@
import Link from "next/link";
import { useReveal } from "@/hooks/use-reveal";
+import { useT } from "@/components/locale-provider";
const STATS = [
["20", "marknader"],
@@ -22,6 +23,7 @@ const PROV = ["var(--prov-0)", "var(--prov-1)", "var(--prov-2)", "var(--prov-3)"
export function HeroSection() {
const ref = useReveal
();
+ const t = useT();
return (
@@ -47,28 +49,31 @@ export function HeroSection() {
- 00 — Datatjänster på beställning
+ {t({ en: "00 — Data services on demand", sv: "00 — Datatjänster på beställning" })}
- Beställ data.
+ {t({ en: "Order data.", sv: "Beställ data." })}
- Validera fält.
+ {t({ en: "Validate fields.", sv: "Validera fält." })}
- Bygg jobbet. Betala hälften. Följ produktionen. Godkänn. Källan syns — alltid.
+ {t({
+ en: "Build the job. Pay half. Track production. Approve. The source is always visible.",
+ sv: "Bygg jobbet. Betala hälften. Följ produktionen. Godkänn. Källan syns — alltid.",
+ })}
- Bygg beställning
+ {t({ en: "Build an order", sv: "Bygg beställning" })}
- Se ett dataset
+ {t({ en: "See a dataset", sv: "Se ett dataset" })}
@@ -87,7 +92,7 @@ export function HeroSection() {
dim_company
- härkomst
+ {t({ en: "provenance", sv: "härkomst" })}
{ROWS.map((r, i) => (
();
+ const t = useT();
return (
-
01 — Filosofi
-
Ärlig data. Visad ärligt.
+
{t({ en: "01 — Philosophy", sv: "01 — Filosofi" })}
+
{t({ en: "Honest data. Shown honestly.", sv: "Ärlig data. Visad ärligt." })}
- Andra säljer säkerhet de saknar.
+ {t({ en: "Others sell certainty they don't have.", sv: "Andra säljer säkerhet de saknar." })}
- Vi visar källan.
+ {t({ en: "We show the source.", sv: "Vi visar källan." })}
{PRINCIPLES.map(([n, title, body], i) => (
diff --git a/components/sections/pricing-section.tsx b/components/sections/pricing-section.tsx
index a1f94e0..416c986 100644
--- a/components/sections/pricing-section.tsx
+++ b/components/sections/pricing-section.tsx
@@ -2,6 +2,7 @@
import Link from "next/link";
import { useReveal } from "@/hooks/use-reveal";
+import { useT } from "@/components/locale-provider";
const MODELS = [
{
@@ -32,18 +33,19 @@ const MODELS = [
export function PricingSection() {
const ref = useReveal
();
+ const t = useT();
return (
-
06 — Priser
-
Tre modeller
+
{t({ en: "06 — Pricing", sv: "06 — Priser" })}
+
{t({ en: "Three models", sv: "Tre modeller" })}
- Tre sätt att köpa.
+ {t({ en: "Three ways to buy.", sv: "Tre sätt att köpa." })}
- Inga överraskningar.
+ {t({ en: "No surprises.", sv: "Inga överraskningar." })}
diff --git a/components/sections/technology-section.tsx b/components/sections/technology-section.tsx
index 861b098..dee5236 100644
--- a/components/sections/technology-section.tsx
+++ b/components/sections/technology-section.tsx
@@ -1,6 +1,7 @@
"use client";
import { useReveal } from "@/hooks/use-reveal";
+import { useT } from "@/components/locale-provider";
const CHAIN = [
["01", "Officiella API:er", "GLEIF · Brreg · Companies House", "var(--prov-3)"],
@@ -13,6 +14,7 @@ const PIPELINE = ["Källracing", "Extraktion", "Strukturering", "Berikning", "QA
export function TechnologySection() {
const ref = useReveal
();
+ const t = useT();
return (
{/* graph-paper hairline texture */}
@@ -38,16 +40,16 @@ export function TechnologySection() {
-
Motorn
+
{t({ en: "The engine", sv: "Motorn" })}
- Lagligt insamlat.
+ {t({ en: "Lawfully collected.", sv: "Lagligt insamlat." })}
- Spårbart varje steg.
+ {t({ en: "Traceable at every step.", sv: "Spårbart varje steg." })}
{/* sourcing chain */}
-
Källkedjan — i prioritet
+
{t({ en: "The sourcing chain — by priority", sv: "Källkedjan — i prioritet" })}
{CHAIN.map(([n, title, sub, color], i) => (
{/* pipeline */}
-
Pipelinen
+
{t({ en: "The pipeline", sv: "Pipelinen" })}
{PIPELINE.map((s, i) => (
@@ -84,7 +86,7 @@ export function TechnologySection() {
))}
- QA körs i pipelinen. Inte vid sidan om.
+ {t({ en: "QA runs inside the pipeline. Not on the side.", sv: "QA körs i pipelinen. Inte vid sidan om." })}
diff --git a/components/sections/testimonials-section.tsx b/components/sections/testimonials-section.tsx
index 446999e..759046c 100644
--- a/components/sections/testimonials-section.tsx
+++ b/components/sections/testimonials-section.tsx
@@ -1,33 +1,35 @@
"use client";
import { useReveal } from "@/hooks/use-reveal";
+import { useT } from "@/components/locale-provider";
-const NUMBERS = [
- ["94%", "Snittkonfidens", true],
- ["50/50", "Start. Godkänt.", false],
- ["<4d", "Leverans", false],
+const NUMBERS: [string, { en: string; sv: string }, boolean][] = [
+ ["94%", { en: "Average confidence", sv: "Snittkonfidens" }, true],
+ ["50/50", { en: "Start. Approved.", sv: "Start. Godkänt." }, false],
+ ["<4d", { en: "Delivery", sv: "Leverans" }, false],
];
export function TestimonialsSection() {
+ const t = useT();
const ref = useReveal
();
return (
-
05 — Bevis
-
Mätbart
+
{t({ en: "05 — Proof", sv: "05 — Bevis" })}
+
{t({ en: "Measurable", sv: "Mätbart" })}
- Siffror.
+ {t({ en: "Numbers.", sv: "Siffror." })}
- Inte löften.
+ {t({ en: "Not promises.", sv: "Inte löften." })}
{NUMBERS.map(([n, l, red], i) => (
0{i + 1}
@@ -37,14 +39,17 @@ export function TestimonialsSection() {
>
{n}
-
{l}
+
{t(l)}
))}
- "Vi litar på listan innan vi ringer. Härkomsten per kontakt avgjorde."
+ {t({
+ en: "“We trust the list before we dial. The per-contact provenance is what sealed it.”",
+ sv: "“Vi litar på listan innan vi ringer. Härkomsten per kontakt avgjorde.”",
+ })}
diff --git a/components/states.tsx b/components/states.tsx
index e1355bc..e5b2920 100644
--- a/components/states.tsx
+++ b/components/states.tsx
@@ -1,6 +1,7 @@
"use client";
import { DataArtifact } from "@/components/data-artifact";
+import { useT } from "@/components/locale-provider";
/**
* Shared loading / empty / error states for the 0pt portal.
@@ -14,16 +15,17 @@ import { DataArtifact } from "@/components/data-artifact";
/** Hairline shimmer rows — a slow sweep travels left→right across each bar. */
export function LoadingSkeleton({ rows = 5 }: { rows?: number }) {
+ const t = useT();
return (
- laddar
+ {t({ en: "loading", sv: "laddar" })}
·
@@ -42,7 +44,7 @@ export function LoadingSkeleton({ rows = 5 }: { rows?: number }) {
))}
-
Laddar innehåll
+
{t({ en: "Loading content", sv: "Laddar innehåll" })}