React Native localization with Expo and i18nexus

React

Add offline translations and a language switcher. Let i18nexus handle your copy, AI translations, and team review.

Expo · TypeScript · react-i18next

Last updated: September 2026

1. Start with Expo

We'll build a small React Native app in English and German. react-i18next renders the text, while i18nexus manages your source strings, AI translations, and team review. The translations ship with your app, so they work offline.

Use Node.js 24 LTS (24.3 or newer). Expo's blank TypeScript template gives us an App.tsx entry point and keeps this example small:

npx create-expo-app@latest my-app --template blank-typescript
cd my-app
npm install i18next@^27.2.4 react-i18next@^18.0.3 intl-pluralrules
npx expo install expo-localization

Already using Expo Router? Keep your project and install the translation packages above. Import the i18n setup once in your root app/_layout.tsx or src/app/_layout.tsx, before rendering. Use the screen below in a route instead of replacing App.tsx, and adjust the relative imports to match your folders.

2. Let i18nexus handle your translations

Write your copy once. i18nexus stores your source strings, AI translates them into your project languages, and gives your team a place to review the results. The CLI brings those translations into your app.

Already have an i18nexus project?

Use its project API key instead of creating another project with init. Install @i18nexus/cli as a dev dependency, add the key to .env, and run npx i18nexus pull. Follow the CLI guide to add development and build sync. The library, languages, namespaces, and output path must match the imports in this tutorial.

To create a new i18nexus project, run this from your app directory:

npx @i18nexus/cli@latest init

For this example, use these choices:

  • Sign in or create an account in the browser opened by the CLI.
  • Use i18next as your library. Installed libraries are detected automatically.
  • For a new app, choose that you do not have translation JSON yet. Set English (en) as the base language and German (de) as an additional language.
  • Use one namespace: common.
  • Accept automatic sync in package.json. This installs the CLI locally and adds development and build sync scripts.
Already have translation JSON?

The CLI can detect and import it into your new i18nexus project. Keep your existing language codes and namespaces, and adjust the examples below to match.

If you keep a custom translation folder, the CLI includes it in your sync scripts. For manual pulls, include that same path: npx i18nexus pull --path ./your-folder.

When setup finishes, add the project API key printed by the CLI to .env in the app root. Add .env to .gitignore:

.env
I18NEXUS_API_KEY="your_project_api_key"

Add your first two strings

Open the dashboard link printed by the CLI and add these English strings in the common namespace. The key is what your code uses; the value is what your users read.

Click + String to enter a key and its English text, then save with the checkmark. This sample project uses the default namespace; select common for this tutorial. Your notes column may say Description or Team Notes, depending on your project settings. Select an image to enlarge it.
  • welcome: Welcome to my app!
  • greeting: Hello, {{name}}!

Save each string, then expand its row to see the translations. You can review and edit them in the same place as your source text.

Expand a saved string to review its AI translations. This sample project uses different keys and languages; follow the keys above and use English and German for this guide.

Prefer working with an AI coding assistant? Choose MCP setup during init, then ask your assistant to create these same strings through i18nexus. The MCP guide explains that workflow. The dashboard remains available for you and your team.

Give AI translation a moment to finish, then download the generated JSON before adding the imports in the next step:

npx i18nexus pull

You should now have locales/en/common.json and its German equivalent. These are generated files: make future string changes in i18nexus and let the CLI sync them.

The CLI recognizes Expo and React Native projects and puts the JSON in locales at the project root. This example uses locales/en/common.json and locales/de/common.json.

The API key is used by the CLI on your computer and build server. You do not need to import it into the app or give it an EXPO_PUBLIC_ prefix.

3. Connect i18next

Create i18n.ts at the project root. Import the plural rules polyfill first: Hermes needs it for i18next's plural handling, as covered in the official React Native guide.

i18n.ts
import 'intl-pluralrules';
import i18n from 'i18next';
import {initReactI18next} from 'react-i18next';
import {getLocales} from 'expo-localization';
import en from './locales/en/common.json';
import de from './locales/de/common.json';

i18n.use(initReactI18next).init({
  lng: getLocales()[0]?.languageCode ?? 'en',
  supportedLngs: ['en', 'de'],
  fallbackLng: 'en',
  ns: ['common'],
  defaultNS: 'common',
  resources: {
    en: {common: en},
    de: {common: de}
  },
  interpolation: {escapeValue: false}
});

export default i18n;

The static imports bundle the JSON with your app. Because the resources are already loaded, i18next initializes synchronously and the first screen can render translated text immediately. There is no translation API request when someone opens the app.

We read the device's first language preference at startup. German devices start in German; unsupported languages fall back to English. Missing or empty translations also fall back to English. Add new languages to the imports, resources, and supportedLngs when you enable them in i18nexus.

4. Render text and switch languages

Import the setup before rendering the app, then use useTranslation wherever you need text. The greeting passes name into the Hello, {{name}}! string you created in i18nexus.

App.tsx
import './i18n';
import {StyleSheet, Text, View} from 'react-native';
import {useTranslation} from 'react-i18next';
import LanguageSwitcher from './components/LanguageSwitcher';

export default function App() {
  const {t} = useTranslation('common');

  return (
    <View style={styles.container}>
      <View style={styles.card}>
        <Text accessibilityRole="header" style={styles.title}>
          {t('welcome')}
        </Text>
        <Text style={styles.greeting}>{t('greeting', {name: 'Sam'})}</Text>
        <LanguageSwitcher />
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1, justifyContent: 'center', padding: 24, backgroundColor: '#f1f7fb'
  },
  card: {
    width: '100%', maxWidth: 420, alignSelf: 'center', padding: 28,
    gap: 24, backgroundColor: '#fff', borderRadius: 20
  },
  title: {fontSize: 28, fontWeight: '700', color: '#12334a'},
  greeting: {fontSize: 18, color: '#425c6e'}
});
components/LanguageSwitcher.tsx
import {Button, View} from 'react-native';
import {useTranslation} from 'react-i18next';

export default function LanguageSwitcher() {
  const {i18n} = useTranslation('common');

  return (
    <View style={{flexDirection: 'row', flexWrap: 'wrap', gap: 12}}>
      <Button
        title="English"
        disabled={i18n.resolvedLanguage === 'en'}
        onPress={() => i18n.changeLanguage('en')}
      />
      <Button
        title="Deutsch"
        disabled={i18n.resolvedLanguage === 'de'}
        onPress={() => i18n.changeLanguage('de')}
      />
    </View>
  );
}

Start Expo and open the app in Expo Go or a development build:

npm start

If you accepted automatic sync during init, this runs Expo alongside i18nexus listen. The listener pulls on startup and updates the local JSON when your team changes translations. Reload the app if Fast Refresh does not pick up a change. Starting Expo directly with npx expo start skips that sync script.

English
Deutsch
The same example running in Expo's web preview. Native buttons follow each platform's appearance, and your AI-generated wording may differ.

Switching languages updates components using useTranslation. This example remembers the choice for the current session. For persistence across launches, save the choice with AsyncStorage and read it before initializing i18next and rendering the app.

What if the device language changes?

This example detects the language on startup. On Android, the device language can change while the app is running. To follow that change, read getLocales() when the app returns to the foreground and update i18next, unless the user has saved an explicit language choice. See Expo Localization for platform behavior and per-app language settings.

Add plurals when you need them

In the common namespace, create a plural set named items. Use {{count}} item for English one and {{count}} items for other. i18nexus generates the forms each target language needs. Once the CLI has synced them, render the count:

Inside your screen
<Text>{t('items', {count: 3})}</Text>

i18nexus exports items_one and items_other; your code uses the root key items. The polyfill we imported handles plural rules on Hermes. You can also ask your coding assistant to create the plural set through the i18nexus MCP.

Build with the latest translations

With automatic sync enabled, the CLI adds eas-build-post-install to package.json. This EAS Build hook runs i18nexus pull after installing dependencies and before bundling your app.

Set I18NEXUS_API_KEY in the EAS environment selected by your build profile. Keep dev dependencies installed during the build so the CLI is available. The hook recreates the translation files even if you accepted the CLI's option to ignore them in Git.

For a local native build, EAS Update, or your own CI, run npx i18nexus pull before bundling. EAS Update does not run EAS Build hooks. Updating i18nexus alone does not change an installed app's bundled text; deliver it in a new build or a compatible over-the-air update.

Your team can now manage copy and review translations in i18nexus, while your app uses ordinary local JSON. Give ambiguous strings a short description, and enable Use description as AI context in your project if you want those notes to guide AI translation. Explore the Getting Started guide or MCP guide as your app grows.

Level up your localization

It only takes a few minutes to streamline your translations forever.

Get started