localize.dev

Docs / React Native and Expo

React Native and Expo localization, automated

Translate a React Native or Expo app: Text, placeholders and accessibility labels become t() calls with react-i18next, set up without browser-only APIs.

How it works

Copy in <Text>, placeholder, accessibilityLabel and accessibilityHint is translated, so screen readers speak the user’s language too.

The generated setup reads the device language with Intl instead of browser APIs, and works with Expo Router (app/_layout) or a classic App entry.

Before and after

The engine’s real output for this file. In a real run, the hosted model names the keys from context.

src/screens/OrderStatus.tsx · before
import { Pressable, Text, View } from 'react-native';

export function OrderStatus({ onTrack }) {
  return (
    <View>
      <Text>Your order is on its way</Text>
      <Pressable onPress={onTrack} accessibilityLabel="Track your package">
        <Text>Track package</Text>
      </Pressable>
    </View>
  );
}
src/screens/OrderStatus.tsx · after
import { Pressable, Text, View } from 'react-native';
import { useTranslation } from 'react-i18next';

export function OrderStatus({ onTrack }) {
  const { t } = useTranslation();
  return (
    <View>
      <Text>{t('order_status.your_order_is_on_its')}</Text>
      <Pressable onPress={onTrack} accessibilityLabel="Track your package">
        <Text>{t('order_status.track_package')}</Text>
      </Pressable>
    </View>
  );
}
locales/en.json
{
  "order_status": {
    "your_order_is_on_its": "Your order is on its way",
    "track_package": "Track package"
  }
}

What the setup adds

The first run sets up react-i18next if the project doesn’t have it yet:

  • i18next and react-i18next
  • src/i18n.ts, imported from app/_layout, App or index

Run it

The CLI needs Node.js 22 or later.

npm install --save-dev localize-dev
npx localize-dev login

# Preview, then write the changes
npx localize-dev run --dry-run -l es,fr,de
npx localize-dev run -l es,fr,de

# Or open a pull request instead
npx localize-dev pr -l es,fr,de

Or add the GitHub Action and get a pull request on every push. Try it on your own code first in the playground.