This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.

Expo Localization iconExpo Localization

A library that provides an interface for native user localization information.

Android
iOS
tvOS
Web
Included in Expo Go
Recommended version:
~56.0.6

expo-localization allows you to Localize your app, customizing the experience for specific regions, languages, or cultures. It also provides access to the locale data on the native device. Using a localization library such as lingui-js, react-i18next, react-intl, i18n-js or react-native-intlayer with expo-localization will enable you to create a very accessible experience for users.

Installation

Terminal
- npx expo install expo-localization
- yarn expo install expo-localization
- pnpm expo install expo-localization
- bun expo install expo-localization

If you are installing this in an existing React Native app, make sure to install expo in your project.

Configuration in app config

You can configure expo-localization using its built-in config plugin if you use config plugins in your project (Continuous Native Generation (CNG)). The plugin allows you to configure various properties that cannot be set at runtime and require building a new app binary to take effect. If your app does not use CNG, then you'll need to manually configure the library.

Example app.json with config plugin

app.json
{ "expo": { "plugins": ["expo-localization"] } }

Usage

Find more information about using expo-localization and adding support for right-to-left languages in the Localization guide.

API

import { getLocales, getCalendars } from 'expo-localization';

Behavior

You can use synchronous getLocales() and getCalendars() methods to get the locale settings of the user device. On iOS, the results will remain the same while the app is running.

On Android, the user can change locale preferences in Settings without restarting apps. To keep the localization current, you can rerun the getLocales() and getCalendars() methods every time the app returns to the foreground. Use AppState to detect this.

No API data file found, sorry!