I18NManager API
The I18NManager API provides functionality that allows you work with to Locale and Timezone settings.
I18NManager Example
The following example demonstrates the ability to set timezone and locale values, as well as to setup listeners to be able to update when those values are changed at any time.
import React, { useState } from 'react';
import { AppRegistry, Button, I18nManager ,Text, View } from 'react-native';
const I18nManagerApp = () => {
const [response, setResponse] = useState('');
const [locale, setLocale] = useState('');
const [timezone, setTimezone] = useState('');
const displayLocale = () => {
setLocale(`I18nManager locale value - ${I18nManager.getAppLocale()}`);
};
const displayTimezone = () => {
setTimezone(`I18nManager timezone value - ${I18nManager.getTimezone()}`);
};
const updateLocaleSetting = (newLocale: string) => {
I18nManager.setAppLocale(newLocale);
};
const updateTimezoneSetting = (newTimezone: string) => {
I18nManager.setTimezone(newTimezone);
};
I18nManager.addListener(I18nManager.SettingEventName.Locale, displayLocale);
I18nManager.addListener(I18nManager.SettingEventName.Timezone, displayTimezone);
return (
<View>
<Button title="Display I18n Preferences" onPress={displayI18nPreferences} />
<Text>{response}</Text>
<Button title="Set Locale - en-CA" onPress={updateLocaleSetting("en-CA")} />
<Text>{locale}</Text>
<Button title="Set App TZ - Paris" onPress={updateTimezoneSetting("Europe/Paris")} />
<Text>{timezone}</Text>
</View>
);
};
export default I18nManagerApp;
I18NManager Methods
getAppLocale
I18nManager.getAppLocale();
Gets the app's locale setting. If the app's locale is not set, the system locale is returned.
setAppLocale
I18nManager.setAppLocale(locale);
Sets the app's locale.
Name | Type | Description |
---|---|---|
locale Required | string | BCP-47 formatted locale string |
getSystemLocale
I18nManager.getSystemLocale();
Gets the system's locale setting.
resetLocale
I18nManager.resetLocale();
Resets the app locale back to the system locale.
getTimezone
I18nManager.getTimezone();
Gets the app's timezone setting. If the app's timezone is not set, the system timezone is returned.
setTimezone
I18nManager.setTimezone(timezone);
Sets the apps's timezone.
Parameters:
Name | Type | Description |
---|---|---|
timezone Required | string | OLSON formatted timezone string |
getSystemTimezone
I18nManager.getSystemTimezone();
Gets the system's timezone setting.
resetTimezone
I18nManager.resetTimezone();
Resets the App timezone back to the system timezone.
addListener
I18nManager.addListener(eventName, callback);
Adds a listener for locale or timezone change.
Listener id triggered when another app changes the locale or timezone.
Parameters:
Name | Type | Description |
---|---|---|
eventName Required | string | The string that identifies the event you're listening for. See the following eventName list. |
callback Required | function | The function to be called when the event fires. |
eventName
This can be any of the following values:
I18nManager.SettingEventName.Locale
I18nManager.SettingEventName.Timezone
removeListeners()
I18nManager.removeListeners();
Removes all added event listeners from the I18NManager
object.
Additional Resources
Internationalization and Localization
Last updated: Sep 30, 2025