<commit_before>import React from 'react'
import ReactDOM from 'react-dom'
import { browserHistory } from 'react-router'
import createPiwikConnector from 'piwik-react-router'
import moment from 'moment'

import createStore from './store/createStore'
import setupI18n from './i18n'


// Locale
// ------------------------------------
const i18n = setupI18n()
moment.locale('fr')


// Store Initialization
// ------------------------------------
const store = createStore(window.__INITIAL_STATE__)


// Piwik
// ------------------------------------
const { PIWIK_URL, PIWIK_SITE_ID } = process.env

if (PIWIK_URL && PIWIK_SITE_ID) {
  createPiwikConnector({
    url: PIWIK_URL,
    siteId: PIWIK_SITE_ID
  }).connectToHistory(browserHistory);
}


// Render Setup
// ------------------------------------
const MOUNT_NODE = document.getElementById('root')

let render = () => {
  const App = require('./components/App').default
  const routes = require('./routes').default(store, i18n)

  ReactDOM.render(
    <App store={store} routes={routes} i18n={i18n} />,
    MOUNT_NODE
  )
}


// Development Tools
// ------------------------------------
if (__DEV__) {
  if (module.hot) {
    const renderApp = render
    const renderError = (error) => {
      const RedBox = require('redbox-react').default

      ReactDOM.render(<RedBox error={error} />, MOUNT_NODE)
    }

    render = () => {
      try {
        renderApp()
      } catch (e) {
        // eslint-disable-next-line no-console
        console.error(e)
        renderError(e)
      }
    }

    // Setup hot module replacement
    module.hot.accept([
      './components/App',
      './routes/index'
    ], () =>
      setImmediate(() => {
        ReactDOM.unmountComponentAtNode(MOUNT_NODE)
        render()
      })
    )
  }
}


// Let's Go!
// ------------------------------------
if (!__TEST__) render()
<commit_msg>Fix i18n hot reload and remove useless moment init<commit_after>import React from 'react'
import ReactDOM from 'react-dom'
import { browserHistory } from 'react-router'
import createPiwikConnector from 'piwik-react-router'

import createStore from './store/createStore'


// Store Initialization
// ------------------------------------
const store = createStore(window.__INITIAL_STATE__)


// Piwik
// ------------------------------------
const { PIWIK_URL, PIWIK_SITE_ID } = process.env

if (PIWIK_URL && PIWIK_SITE_ID) {
  createPiwikConnector({
    url: PIWIK_URL,
    siteId: PIWIK_SITE_ID
  }).connectToHistory(browserHistory);
}


// Render Setup
// ------------------------------------
const MOUNT_NODE = document.getElementById('root')

let render = () => {
  const App = require('./components/App').default
  const i18n = require('./i18n').default()
  const routes = require('./routes').default(store, i18n)

  ReactDOM.render(
    <App store={store} routes={routes} i18n={i18n} />,
    MOUNT_NODE
  )
}


// Development Tools
// ------------------------------------
if (__DEV__) {
  if (module.hot) {
    const renderApp = render
    const renderError = (error) => {
      const RedBox = require('redbox-react').default

      ReactDOM.render(<RedBox error={error} />, MOUNT_NODE)
    }

    render = () => {
      try {
        renderApp()
      } catch (e) {
        // eslint-disable-next-line no-console
        console.error(e)
        renderError(e)
      }
    }

    // Setup hot module replacement
    module.hot.accept([
      './components/App',
      './i18n/index',
      './routes/index'
    ], () =>
      setImmediate(() => {
        ReactDOM.unmountComponentAtNode(MOUNT_NODE)
        render()
      })
    )
  }
}


// Let's Go!
// ------------------------------------
if (!__TEST__) render()

{'fraction_non_alphanumeric': 0.23593073593073594, 'fraction_numerical': 0.007575757575757576, 'mean_word_length': 1.8928012519561814, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '563355', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1112, 'n_words': 227}