# Add i18n to an Expo App

Yes. An agent adds expo-localization and a translation layer to your Expo Router app, moves every visible string into locale files, adds a language and opens a PR.

[Run this on Rush](https://cloud.getrush.ai/run/add-i18n/expo/). Opens the console with this prompt ready to send, in a Project that has your repository.

## What the agent does

The agent reads the app's structure and finds every string a user sees. In an app like `stickersmash` in expo/examples, `package.json` sets `main` to `expo-router/entry`, pins `expo` ~58.0.0-preview.7 with `expo-router`, `expo-image-picker`, `expo-media-library` and `@expo/ui`, has `lint` as `expo lint` and no test script, and `tsconfig.json` extends `expo/tsconfig.base` with `strict` on and a `@/*` path alias to `src/`. `app.json` names the app `StickerSmash`, sets `userInterfaceStyle` to `automatic`, enables the `expo-router` and `expo-splash-screen` plugins and the `typedRoutes` and `reactCompiler` experiments. The strings live in a handful of files: the tab labels `Home` and `About` in `src/app/(tabs)/_layout.tsx` as `NativeTabs.Trigger.Label` children; `Choose a photo`, `Use this photo`, `Reset`, `Save` and the two `alert()` messages in `src/app/(tabs)/index.tsx`; `About screen` in `about.tsx`; the `Oops! Not Found` title and the `Go back to Home screen!` link in `+not-found.tsx`; and `Choose a sticker` in `src/components/emoji-picker.tsx`. `Button` and `IconButton` already take a `label` prop, so the component tree needs no restructuring.

From that the agent adds the dependencies with `npx expo install expo-localization i18n-js`, so the versions match the installed SDK rather than whatever npm resolves, and creates `src/i18n/` with `en.json`, a second locale file the prompt names, and an `index.ts` that builds an `I18n` instance with both dictionaries, `enableFallback` on and English as the default. Device language comes from `expo-localization`'s `useLocales` hook, so a hook `useT()` in the same directory returns a translation function bound to the first locale's `languageCode` and re-renders when the system language changes; `i18n-js` on its own is not reactive, which is why the hook exists. Every literal above becomes a `t('home.choosePhoto')` style call with a namespaced key, including the `alert()` messages and the `Stack.Screen` title in the not-found route.

Two things in this app need care. `NativeTabs.Trigger.Label` takes its text as children, so the tab layout calls the hook and passes `t('tabs.home')` as a child rather than a prop. And `app.json` has a `locales` field for native strings on iOS and Android, such as the display name and permission prompts, which the agent documents and adds for the second language only if the prompt asks, because it changes the native build rather than the JavaScript bundle.

The checks are what the repository can run: `npx tsc --noEmit` passes with `strict`, since `typescript` is a dev dependency, `npm run lint` passes, a short script asserts both locale files carry the same keys so a missing translation fails before review, and `npx expo export --platform web` bundles the app, showing the new modules resolve. The second language's text is marked as a draft for a native speaker in the pull request.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Add internationalization to this Expo Router app. Read package.json, app.json, tsconfig.json and every file under src/app and src/components first. Install expo-localization and i18n-js with npx expo install so versions match the SDK. Create src/i18n with en.json, es.json and an index.ts that builds an I18n instance with fallback to English, plus a hook built on expo-localization's useLocales so the translation function follows the device language and re-renders when it changes. Move every user-facing string, including alert messages, tab labels and screen titles, into the locale files with namespaced keys and replace each literal with a call to the hook. Keep the Spanish text marked as a draft for a native speaker. Do not add native locales to app.json unless asked; document them instead. Run npx tsc --noEmit, npm run lint, a script that checks both locale files have the same keys, and npx expo export --platform web, then open a pull request that lists each string and its key.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

What comes back is a pull request on its own branch with `src/i18n/en.json`, `src/i18n/es.json`, `src/i18n/index.ts`, the edited screens under `src/app/` and `src/components/emoji-picker.tsx`, and `package.json` plus the lockfile with the two new dependencies. `app.json`, the splash and icon assets and the platform-specific button variants are untouched, since the latter take their text through the `label` prop.

The description lists every string it found with the key it now has and the file it came from, the type check, lint and key-parity output, and the export summary. The commands are in the transcript at `GET /o/{org}/sessions/{id}/messages`, so a reviewer can see each check without running it.

Before merging, a reviewer asks a Spanish speaker to read `es.json`, runs the app in Expo Go with the device language switched to confirm the tabs and buttons change, and decides whether to add the native `locales` entry in `app.json` for the display name and permission strings, which the pull request describes. A follow-up message to the same session adds a third language with the same keys.

## Run it on every Linear issue labelled i18n

A team that tracks localization in Linear starts one run per issue from an automation with a `linear` trigger on the `i18n` label. The automation adds the issue after this prompt, so a screen the issue says still shows English, or a second language it asks for, is what the agent reads, and the run starts in the repository the automation names.

Each run opens its own pull request from its own sandbox, and an automation run has its own `max_runs_per_hour` cap. The pull request links the issue and lists each string and key, so the translator's review is a read of one JSON file.

## Why run it on Rush?

The work in localizing a mobile app is finding every string and keeping the locale files in step, not the library choice. The agent reads each route and component rather than searching for quotes, keeps the component props as they are, and treats a strict type check, the linter, a key-parity script and a web export as the test, in its own sandbox with the real SDK installed.

The pull request carries that proof in the transcript, beside the commands that produced it, and names what was left out, the native `locales` entry, with the reason. Several apps can be handled at once, each in its own sandbox, with one pull request each.

## Frequently asked questions

### Why install with npx expo install instead of npm install?

`expo install` picks the versions of `expo-localization` and other Expo modules that match the SDK in `package.json`, which matters on a preview SDK like the one this app pins. A plain `npm install` could pull a version built for a different SDK and fail at bundle time.

### Does the app re-render when the device language changes?

Yes. The hook reads `useLocales()` from `expo-localization`, which updates when the system locale changes, and rebinds the translation function to the new language code. `i18n-js` alone would keep the old locale until the app restarted, which is why the hook wraps it.

### What about the app name and permission prompts?

Those are native strings and live in `app.json` under `locales`, per language, not in the JavaScript bundle. The agent documents the entry and the files it would point at, and adds them only when the prompt asks, because they change the native build and need a new development build to see.

### Who writes the Spanish text?

The agent drafts it and marks it as a draft for a native speaker in the pull request. The key set, the parity between the two files and the type check are what the run guarantees; the wording is for a reviewer who speaks the language.

## More Expo jobs

- [Add Over-the-Air Updates to an Expo App](https://getrush.ai/run/add-ota-updates/expo/)
- [Add Push Notifications to an Expo App from a Linear Issue](https://getrush.ai/run/add-push-notifications/expo/)
- [Add Storybook to an Expo App](https://getrush.ai/run/add-storybook/expo/)

## The same job on other stacks

- [Add Internationalisation to a Filament Admin Panel from a Linear Issue](https://getrush.ai/run/add-i18n/filament/)
- [Add i18n to a Flutter App](https://getrush.ai/run/add-i18n/flutter/)
- [Add i18n to a Gatsby Blog](https://getrush.ai/run/add-i18n/gatsby/)

## Keep reading

- [How a Rush run works on your repository, from request to pull request](https://getrush.ai/cloud/)
- [Compare cloud agents, agent sandboxes and AI code review](https://getrush.ai/compare/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
