Skip to content

Serve the blog in English and German - #24

Merged
PatrickLaabs merged 2 commits into
mainfrom
claude/project-thread-bnvr23
Oct 20, 2026
Merged

PatrickLaabs merged 2 commits into
mainfrom
claude/project-thread-bnvr23

Conversation

@PatrickLaabs

@PatrickLaabs PatrickLaabs commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Before: the blog is English only.

After: there is a German version under /de/ with its own interface texts and German dates ("20. Okt. 2026"). An EN/DE switcher in the nav jumps to the same page in the other language. English URLs stay unchanged.

A post gets a German version by adding posts/<date>-<slug>.de.md next to the English file (make translate-post POST=<slug> LANG=de copies it to start with). Translations are optional: a post without one is still listed on the other language's front page with a small EN/DE badge, and opening it shows the original with a note ("Diesen Beitrag gibt es nur auf Englisch.") and a canonical link to the original URL. German-only posts work the same way in reverse (make new-post TITLE=… LANG=de).

How: posts are now loaded into a Library keyed by slug and language, and the routes are registered once per language from the list in i18n.go, which also holds the interface strings. Pages carry hreflang alternates and x-default. The interactive widgets (terminal, Chaos Monkey, load balancing) stay English for now. hello-world comes with a German translation as the first example.

English stays at / and /posts/{slug}; German lives under /de/. A post
gets a German version by adding posts/<date>-<slug>.de.md next to it.
Posts without a translation are still listed and shown with the
interface of the requested language, a note saying which language the
post is in, and a canonical link to the original.

The nav gets an EN/DE switcher, pages carry hreflang links, and
make translate-post starts a translation from the original.
@PatrickLaabs PatrickLaabs self-assigned this Oct 20, 2026
@PatrickLaabs
PatrickLaabs merged commit 458f99c into main Oct 20, 2026
1 check passed
@PatrickLaabs
PatrickLaabs deleted the claude/project-thread-bnvr23 branch October 20, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant