feat: German as the main language, English under /en, with a language switch

The site now exists in German (at the root, with /impressum and /datenschutz)
and English (/en). A request without a language follows the visitor's choice
from the language switch, then the browser language, then German; the old
English legal addresses move to /en for good.

All visible texts are data in src/content/de.ts and en.ts, so components hold
none of their own. The header carries a DE/EN switch whose bit curtain covers
the page while it is swapped and reopens at the same reading position. Title,
description, canonical, hreflang, Open Graph, the share image, the sitemap and
the structured data are per language. The privacy notice now describes the
cookie that remembers the chosen language.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-04 13:07:22 +02:00
co-authored by Claude Opus 5.5
parent e89a248ca5
commit 75993100fa
72 changed files with 4418 additions and 1405 deletions
@@ -7,6 +7,7 @@ import {
const input: StructuredDataInput = {
siteUrl: "https://example.com",
pageUrl: "https://example.com/",
siteName: "Jane Doe",
language: "en",
description: "Freelance web developer.",
@@ -23,6 +24,7 @@ const input: StructuredDataInput = {
locality: "Town",
countryCode: "DE",
},
catalogName: "Services",
services: [
{ name: "Web app development", description: "I join your project." },
{ name: "Website development", description: "A website, built for you." },
@@ -128,6 +130,7 @@ describe("buildStructuredData", () => {
expect(node(buildStructuredData(input), "FAQPage")).toEqual({
"@type": "FAQPage",
"@id": "https://example.com/#faq",
inLanguage: "en",
mainEntity: [
{
"@type": "Question",
@@ -143,6 +146,43 @@ describe("buildStructuredData", () => {
});
});
it("describes the page in its own language: questions, catalogue and website", () => {
const data = buildStructuredData({
...input,
pageUrl: "https://example.com/de",
language: "de",
catalogName: "Leistungen",
});
expect(node(data, "FAQPage")).toMatchObject({
"@id": "https://example.com/de#faq",
inLanguage: "de",
});
expect(node(data, "ProfessionalService")).toMatchObject({
hasOfferCatalog: { name: "Leistungen" },
});
expect(node(data, "WebSite")).toMatchObject({ inLanguage: "de" });
});
it("names the same person, business and website on the page of every language", () => {
const data = buildStructuredData({
...input,
pageUrl: "https://example.com/de",
language: "de",
});
expect(node(data, "WebSite")).toMatchObject({
"@id": "https://example.com/#website",
url: "https://example.com",
});
expect(node(data, "Person")).toMatchObject({
"@id": "https://example.com/#person",
url: "https://example.com",
});
expect(node(data, "ProfessionalService")).toMatchObject({
"@id": "https://example.com/#business",
url: "https://example.com",
});
});
it("leaves out the questions node when there are no questions", () => {
const data = buildStructuredData({ ...input, faq: [] });
expect(data["@graph"].map((entry) => entry["@type"])).toEqual([