Proposal
Add complete Spanish language support to Halupedia, including:
- Fully translated UI (buttons, labels, messages)
- Spanish article generation (preserving the 19th-century scholarly deadpan tone)
- Automatic language detection via
Accept-Language header + manual override
Why this matters
- Makes Halupedia accessible to ~500M Spanish speakers worldwide
- Preserves the project's unique voice in another major language
- Demonstrates the architecture's multilingual flexibility
- No breaking changes for existing English-only users
Implementation plan
New files
src/locales/en.json - English UI strings (extracted from components)
src/locales/es.json - Spanish UI strings
src/worker/locale.ts - Language detection + bilingual system prompts
src/client/i18n.tsx - React i18n context provider
Modified files
src/worker/llm.ts - Use locale-aware system prompts
src/worker/identity.ts - Generate Spanish names when locale=es
src/client/App.tsx - Wrap with I18nProvider, use useTranslation()
src/client/Comments.tsx - Translate all UI text
wrangler.toml - Add DEFAULT_LOCALE env var (optional)
Technical approach
Language detection (priority order)
- Cookie
halupedia_locale (if set by user)
Accept-Language header (auto-detect)
- Default to
en
Spanish system prompt (preserves the voice)
// Victorian Spanish academic tone, circa 1890
"Eres la voz de la Halupedia, una enciclopedia del siglo XIX que alucina artículos sobre la marcha.
Escribe en un tono académico serio, propio de una enciclopedia victoriana española...
Inventa hechos con total confianza..."
Proposal
Add complete Spanish language support to Halupedia, including:
Accept-Languageheader + manual overrideWhy this matters
Implementation plan
New files
src/locales/en.json- English UI strings (extracted from components)src/locales/es.json- Spanish UI stringssrc/worker/locale.ts- Language detection + bilingual system promptssrc/client/i18n.tsx- React i18n context providerModified files
src/worker/llm.ts- Use locale-aware system promptssrc/worker/identity.ts- Generate Spanish names when locale=essrc/client/App.tsx- Wrap with I18nProvider, useuseTranslation()src/client/Comments.tsx- Translate all UI textwrangler.toml- AddDEFAULT_LOCALEenv var (optional)Technical approach
Language detection (priority order)
halupedia_locale(if set by user)Accept-Languageheader (auto-detect)enSpanish system prompt (preserves the voice)