How to use the expo-localization.getLocalizationAsync function in expo-localization

To help you get started, we’ve selected a few expo-localization examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github digidem / mapeo-mobile / src / frontend / App.js View on Github external
React.useEffect(() => {
    // Localization only changes in Android (in iOS the app is restarted) and
    // will only happen when the app comes back into the foreground
    if (Platform.OS !== "android" || appState !== "active") return;
    Localization.getLocalizationAsync()
      .then(({ locale }) => setLocale(locale || "en"))
      .catch(() => {});
  }, [appState]);