Closed dbarnett closed 6 months ago
I don't really want to use sub-paths or subdomains like the Next.js i18n docs and a lot of popular libraries seem to prefer. Instead I want the home page for every supported language to live at https://mumind.me/, and determine which supported language to render based on this precedence:
hl
param, cookies) — Regardless of other settings, the site should offer a language selector for users to manually pick a different language, remembering that choice in a sticky hl
param in the URL (and maybe cookies/storage so it will stick across site visits)And I would like all locale-dependent content to update instantly, done in-place as much as possible, when the language preference changes.
Current implementation has a lot of rough edges, but covers most of the basics. Remaining TODOs:
?hl=en
used my default locale of es-MX instead of the better match en-USlang="es-MX"
with most of the actual content wrapped in lang="en-US"
on pages like blog posts where the majority of content isn't translated, it would probably be better to signal up to the page root to just call itself consistently lang="en-US"
Lots of potential cleanup to do as I give it more time to soak, finding libraries to clean up bits where I've reinvented the wheel and/or maybe publishing some self-contained valuable bits in libraries of my own.
Add support for viewing some of the main pages in more than one language (Spanish in addition to English).