{"size": 901, "ext": "js", "max_stars_repo_path": "detox/test/src/Screens/LanguageScreen.js", "max_stars_repo_name": "spnraju/Detox", "max_stars_repo_stars_event_min_datetime": "2018-09-03T05:13:26.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T13:50:16.000Z", "max_issues_repo_path": "detox/test/src/Screens/LanguageScreen.js", "max_issues_repo_name": "spnraju/Detox", "max_issues_repo_issues_event_min_datetime": "2018-09-02T09:31:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T23:16:05.000Z", "max_forks_repo_path": "detox/test/src/Screens/LanguageScreen.js", "max_forks_repo_name": "spnraju/Detox", "max_forks_repo_forks_event_min_datetime": "2018-09-04T10:50:32.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-30T14:14:45.000Z"}
{"max_stars_count": 6289, "max_issues_count": 1942, "max_forks_count": 1672, "avg_line_length": 32.1785714286, "max_line_length": 96, "alphanum_fraction": 0.6259711432}
import React, { Component } from 'react';
import { Text, View, NativeModules, Platform } from 'react-native';
import _ from 'lodash';

export default class LanguageScreen extends Component {
  render() {

    const locale = Platform.select({
        ios: () => NativeModules.SettingsManager.settings.AppleLocale,
        android: () => NativeModules.I18nManager.localeIdentifier
    })();

    const language = Platform.select({
        ios: () => _.take(NativeModules.SettingsManager.settings.AppleLanguages, 1),
        android: () => 'Unavailable'
    })();

    return (
      <View style={{ flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center' }}>
        <Text style={{ fontSize: 25, marginBottom: 30 }}>Current locale: {locale}</Text>
        <Text style={{ fontSize: 25, marginBottom: 30 }}>
          Current language: {language}
        </Text>
      </View>
    );
  }
}
