Better I18NBetter I18N
Expo

API Reference

Complete API documentation for @better-i18n/expo

Complete API reference for the Expo/React Native SDK.

initBetterI18n

The primary API. Fetches translations from the better-i18n CDN, initializes i18next with all namespaces pre-loaded, and overrides changeLanguage() to pre-load translations before switching.

import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import { initBetterI18n } from '@better-i18n/expo';

i18n.use(initReactI18next);

const { languages, core } = await initBetterI18n({
  project: 'acme/my-app',
  i18n,
  defaultLocale: 'en',
  useDeviceLocale: true,
  debug: __DEV__,
});

What it does

  1. Fetches the project manifest and initial translations from CDN in parallel
  2. Auto-discovers all namespaces and picks "common" as the default (or first available)
  3. Initializes i18next with translations pre-loaded into the resource store
  4. Overrides changeLanguage() to pre-load translations before switching (no English flash)
  5. Registers a languageChanged listener as a safety net for lazy loading

Options

Return Value

Do not call i18n.init() separately — initBetterI18n handles initialization internally. Use i18nextOptions to pass custom i18next settings.


Locale Detection


Storage


Types

On this page