title: Change language of whole react-native app
body: <p>My app in react-native has 2 languages: english and french. I've done a i18n.js file and 2 "translation.js" files for english and french. It's working great (i've tried it setting french on my phone, english on the emulator). </p>
  
  <p>Now, I want to make a button in the app's settings to change the language of the entire app for the user but I don't know what function call and how to create this. </p>
  
  <p>Can you help me ? 
  Thanks a lot for your time and help. </p>
  
  <p>my i18n.js file; </p>
  
  <pre><code>import i18n from "i18next";
  import detector from "i18next-browser-languagedetector";
  import { reactI18nextModule } from "react-i18next";
  import { NativeModules, Platform } from "react-native";
  
  import en from "../public/locales/en/translation.js";
  import fr from "../public/locales/fr/translation.js";
  
  // the translations
  const resources = {
    en: {
      translation: en
    },
    fr: {
      translation: fr
    }
  };
  const locale =
    Platform.OS === "ios"
      ? NativeModules.SettingsManager.settings.AppleLocale
      : NativeModules.I18nManager.localeIdentifier;
  
  i18n.locale = locale;
  
  i18n
    .use(detector)
    .use(reactI18nextModule) // passes i18n down to react-i18next
    .init({
      resources,
      lng: locale.substring(0, 2),
      fallbackLng: "en", // use en if detected lng is not available
  
      keySeparator: ".", // we do not use keys in form messages.welcome
  
      interpolation: {
        escapeValue: false // react already safes from xss
      }
    });
  
  export default i18n;
  </code></pre>
  
  <p>And I'd like to change the language from my Settings.js file : </p>
  
  <pre><code>&lt;SettingsList.Item
                // icon={&lt;Image style={styles.image} source={require('../../assets/images/icon_vol-mute.png')}/&gt;}
                title={i18n.t("settings.action.languages")}
                hasNavArrow={false}
                switchState={this.state.activeSwitch === 3}
                switchOnValueChange={this.switchThree}
                hasSwitch={true}
                onPress={() =&gt; Alert.alert("French / English")}
              /&gt;
  </code></pre>