<commit_before>import { connect } from "react-redux";
import intl from "react-intl-universal";
import PropTypes from "prop-types";
import React from "react";

class App extends React.Component {
  constructor(props) {
    super(props);
    let currentLocale = props.locale;
    intl.init({
      currentLocale,
      locales: {
        [currentLocale]: require(`../locales/${currentLocale}`)
      }
    });
  }
  render() {
    return (
      this.props.children
    );
  }
}

App.propTypes = {
  locale: PropTypes.string,
  children: PropTypes.element
};

function mapStateToProps(state) {
  return {
    locale: state.applicationAppState.get("navigator_language")
  };
}

export default connect(mapStateToProps)(App);
<commit_msg>Fix dynamic language change<commit_after>import { connect } from "react-redux";
import intl from "react-intl-universal";
import PropTypes from "prop-types";
import React from "react";

class App extends React.Component {
  constructor(props) {
    super(props);
    // let currentLocale = props.locale;
    // intl.init({
    //   currentLocale,
    //   locales: {
    //     [currentLocale]: require(`../locales/${currentLocale}`)
    //   }
    // });
  }
  render() {
    let currentLocale = this.props.locale;
    intl.init({
      currentLocale,
      locales: {
        [currentLocale]: require(`../locales/${currentLocale}`)
      }
    });
    return (
      this.props.children
    );
  }
}

App.propTypes = {
  locale: PropTypes.string,
  children: PropTypes.element
};

function mapStateToProps(state) {
  return {
    locale: state.applicationAppState.get("navigator_language")
  };
}

export default connect(mapStateToProps)(App);

{'fraction_non_alphanumeric': 0.1394517282479142, 'fraction_numerical': 0.0, 'mean_word_length': 3.075242718446602, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3586615', 'n_tokens_mistral': 515, 'n_tokens_neox': 521, 'n_words': 103}