Labels.io

Internationalization

URL-based locales with a live language switcher.

The marketing site is fully translatable and ships with English and Spanish:

  • URL-based locales: / is English, /es is Spanish, via an optional {-$locale} path segment
  • /en/... canonically redirects to /...
  • A segmented EN | ES switcher in the header
  • All copy in flat key files: app/locales/en.json and es.json

App routes (/app, /docs, auth) stay unlocalized on purpose; localize them later if your product needs it.

Adding a language

Say "add Japanese". The add-i18n.md skill:

  1. creates app/locales/ja.json and translates the keys
  2. registers ja in the supported locales list
  3. adds it to the switcher

Writing translatable copy

Use the useT() hook and a key instead of hardcoding strings:

const t = useT()
<h1>{t('hero.titleLead')}</h1>

If a string only exists in one component and one language today, it is still worth a key; future-you will not have to hunt it down.

On this page