Features
Internationalization (i18n)
10/11/2026
Add and switch translations in the Expo template.
Current setup
The template uses i18next and react-i18next. services/i18n.ts registers the bundled locale files:
locales/en.jsonlocales/id.json
The device language is used during initialization, with English as the fallback. The preferences store then applies the persisted language after local storage hydration.
import { useTranslation } from 'react-i18next';
export function WelcomeTitle() {
const { t } = useTranslation();
return <Text>{t('welcome.title')}</Text>;
}Changing language
Use usePreferencesStore().setLanguage(...) or the existing language settings screen. The setter persists the value locally and, in Account mode, schedules a debounced PUT /api/v1/app/preferences update. Guest mode never sends this request.
Add a locale
- Copy
locales/en.jsonto a new JSON file such aslocales/es.json. - Add the resource to
services/i18n.ts. - Add the language to the settings picker and type any supported language list used by the UI.
- Keep the same key structure across all locale files.
- Test both the first render (device locale) and the post-hydration render (saved preference).
Translation guidance
- Use semantic, nested keys such as
auth.login.title. - Keep interpolation values separate from translated text.
- Do not hardcode user-facing strings in new screens.
- Add keys to every bundled locale or provide an intentional English fallback.
Relevant files
services/i18n.tslocales/en.jsonandlocales/id.jsonstore/preferences-store.tsapp/settings/general.tsx
