Skip to content

feat(i18n): add English multilingual support (Phase 1)#69

Merged
calderbuild merged 3 commits intomainfrom
feat/i18n-english
Mar 9, 2026
Merged

feat(i18n): add English multilingual support (Phase 1)#69
calderbuild merged 3 commits intomainfrom
feat/i18n-english

Conversation

@calderbuild
Copy link
Owner

Summary

  • Full bilingual (Chinese + English) support for all marketing pages, Finder UI, API responses, SEO pages, and AI Chat
  • Lightweight JSON i18n (372 keys per language), no heavy dependencies -- fits within Render 512MB limit
  • Language detection chain: URL prefix /en/ > Cookie lang > Accept-Language header > default Chinese
  • English routes at /en/, /en/about, /en/faq, /en/how-it-works, /en/meetspot/{city}
  • hreflang tags + bilingual sitemap for SEO
  • Client-side JS i18n for standalone Finder HTML with data-i18n attributes
  • Bilingual AI Chat: English system prompt, preset questions, widget text
  • API error messages localized (quota, rate limit, config errors)

Test plan

  • Visit / -- Chinese homepage renders correctly
  • Visit /en/ -- English homepage renders correctly
  • Click language toggle (EN/中文) -- switches language, sets cookie
  • Visit /en/about, /en/faq, /en/how-it-works -- English content
  • Visit /public/meetspot_finder.html -- Finder language toggle works
  • Visit /sitemap.xml -- contains English URL variants with hreflang
  • AI Chat widget shows correct language based on page
  • API returns English error messages when lang=en cookie set

calderbuild added 3 commits March 8, 2026 14:48
- Create lightweight JSON i18n system (app/i18n.py) with language
  detection chain: URL /en/ > Cookie > Accept-Language > default zh
- Extract 372 translation keys to locales/zh.json + locales/en.json
- Add /en/* routes for all SSR pages (home, about, faq, how-it-works, city)
- Add language toggle (EN/中文) in nav with cookie persistence
- Add hreflang tags and bilingual sitemap with xhtml:link
- Mount /locales/ static route for client-side JS i18n
- Update all Jinja2 templates to use translation dict
- Update seo_content.py city content generation with lang parameter
- Finder HTML: client-side JS i18n with data-i18n attributes, language
  toggle, _t() helper, initI18n() for cookie/Accept-Language detection
- API: localized error messages (quota, rate limit, config errors) via
  detect_language() + translation keys
- AI Chat: English system prompt, bilingual preset questions, chat
  widget uses template translation variables, sends lang parameter
- City template: venue header uses translation key with {city} placeholder
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 9, 2026

Deploying meetspot with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9903179
Status: ✅  Deploy successful!
Preview URL: https://d0edc241.meetspot.pages.dev
Branch Preview URL: https://feat-i18n-english.meetspot.pages.dev

View logs

@calderbuild calderbuild merged commit d173d6b into main Mar 9, 2026
12 checks passed
@calderbuild calderbuild deleted the feat/i18n-english branch March 9, 2026 05:38
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