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,/esis 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.jsonandes.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:
- creates
app/locales/ja.jsonand translates the keys - registers
jain the supported locales list - 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.