Change app locale via iOS UserDefaults, or Android SharedPreferences.
npm install react-native-locale-manager$ npm install react-native-locale-manager --save
$ react-native link react-native-locale-manager
#### iOS
1. In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]
2. Go to node_modules ➜ react-native-locale-manager and add RNLocaleManager.xcodeproj
3. In XCode, in the project navigator, select your project. Add libRNLocaleManager.a to your project's Build Phases ➜ Link Binary With Libraries
4. Run your project (Cmd+R)<
#### Android
1. Open up android/app/src/main/java/[...]/MainActivity.java
- Add import com.reactlibrary.RNLocaleManagerPackage; to the imports at the top of the file
- Add new RNLocaleManagerPackage() to the list returned by the getPackages() method
2. Append the following lines to android/settings.gradle:
```
include ':react-native-locale-manager'
project(':react-native-locale-manager').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-locale-manager/android')
android/app/build.gradle
3. Insert the following lines inside the dependencies block in :`
`
compile project(':react-native-locale-manager')
This module does not read device locale.
This module works in conjunction with https://github.com/stefalda/ReactNativeLocalization
`javascript
import LocaleManager from 'react-native-locale-manager';
// get locale
LocaleManager.get().then((locale) => {
console.log("Locale: ", locale)
// Alert user to restart app to see language changes.
});
// set locale
LocaleManager.set(locale);
// clear
LocaleManager.clear();
``