Skip to content

Add i18n (internationalization) support #5

@wassertim

Description

@wassertim

Summary

The app currently has no internationalization support. All UI strings are hardcoded in English. Add lightweight i18n to support multiple languages.

Proposed Approach

Locale resolution (priority order):

  1. Query param override (?lang=fr)
  2. Accept-Language request header
  3. Default fallback (en)

Translation system:

  • Simple JSON key-value files per locale (e.g. locales/en.json, locales/fr.json)
  • Thin t(key, locale) helper function for string lookup
  • No heavy frameworks — keep it minimal and aligned with the project's KISS principle

Integration:

  • Read locale in Hono middleware, attach to context
  • Use t() in JSX components for all user-facing strings
  • Extract existing hardcoded English strings into locales/en.json

Relevant Standards

  • BCP 47 for language tags (en-US, fr-FR)
  • Accept-Language header (RFC 9110) for browser negotiation
  • ICU MessageFormat for plurals/interpolation if needed later

Tasks

  • Create locales/en.json with all existing UI strings
  • Implement t(key, locale) lookup helper
  • Add Hono middleware to resolve locale from request
  • Update JSX components to use t() instead of hardcoded strings
  • Add at least one additional locale as a proof of concept

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions