SoConnective

Guides

Guide — Internationalization (i18n)

How the EN/ES bilingual setup of the website works and how to add or edit translations. Update this if the i18n system changes.

Summary

  • Engine: next-intl ("no routing" mode, cookie-based).
  • Primary language: English (en). Secondary: Spanish (es).
  • The language is stored in the locale cookie (default en).
  • There is an EN/ES toggle in the header (components/headers/LanguageSwitcher.tsx).
  • There are no /es or /en routes (the template's route structure was not touched).

Key files (in apps/web/)

FileFunction
i18n/request.tsReads the locale cookie and loads messages/${locale}.json
messages/en.jsonEnglish text (source)
messages/es.jsonSpanish translation
next.config.tsRegisters the createNextIntlPlugin plugin
app/layout.tsxWraps the app in NextIntlClientProvider and sets <html lang>
components/headers/LanguageSwitcher.tsxEN/ES toggle (set cookie + router.refresh())

How a text is translated

  1. In the component: use const t = useTranslations("section") and {t("key")}.
  2. Add the key to both catalogs:
    • messages/en.json → English text
    • messages/es.json → Spanish text
  3. Keep the same key structure in both files.

What is translated today

  • Header, Footer and the entire home (Creative Agency): Hero, About, Projects, Services, Testimonials, Blog preview, CTA.

Pending (remains in English for now)

Pages: about, contact, services, team, pricing, faq, 404, blog, projects and the other home demos. When translating new content, always do it through catalogs (do not hardcode text).

Technical note

Because the cookie is read in the layout, all routes are rendered on-demand (not static). This is the expected trade-off of the cookie mode without routing.

Previous
Runbook 05 — Platform apps (backend, CRM, portal)