@amazon-devices/expo-localization provides an interface for native user localization information.
This library provides the getCalendars() and getLocales() method and their corresponding hooks, which return specific information about a user’s locale settings, for example languageCode, uses24HourClock, currencyCode, and textDirection. The library doesn’t provide any methods for formatting text or values. Hooks trigger a re-render when the app locale changes.
This library is system-deployed and available to React Native for Vega apps without a separate installation process. This autolinking library connects to your app at runtime. Compatibility is guaranteed only between the library and the version of React Native for Vega for which it is built.
Installation
-
Add the JavaScript library dependency in the
package.jsonfile. -
Reinstall dependencies using the
npm installcommand.
Examples
The example below demonstrates how to retrieve a user’s language code.API reference
See the documentation page for information about this library and API reference: Official Expo documentation for expo-localization.Constants
Hooks
Methods
Known issues and limitations
- The
regionfield onLocalizationtype is always null on Vega. - Functions
useLocales(),useCalendars(),getCalendars(), andgetLocales()always return an array with one item in it, while other platforms might return an empty array or multiple valid locales/calendars.

