import {addLocaleData} from 'react-intl';
import {updateIntl as superUpdateIntl} from 'react-intl-redux';
import languages from '../languages.json';
import messages from '../../locale/messages.json';
import {IntlProvider, intlReducer} from 'react-intl-redux';

Object.keys(languages).forEach(locale => {
    // TODO: will need to handle locales not in the default intl - see www/custom-locales
    // eslint-disable-line import/no-unresolved
    import(`react-intl/locale-data/${locale}`).then(data => addLocaleData(data));
});

const intlInitialState = {
    intl: {
        defaultLocale: 'en',
        locale: 'en',
        messages: messages.en
    }
};

const updateIntl = locale => superUpdateIntl({
    locale: locale,
    messages: messages[locale] || messages.en
});

export {
    intlReducer as default,
    IntlProvider,
    intlInitialState,
    updateIntl
};

@@ -184,32 +184,77 @@
 /messages.json';
+ // eslint-disable-line import/no-unresolved%0A
 %0Aimport %7BIntlPro
@@ -436,56 +436,8 @@
 les%0A
-    // eslint-disable-line import/no-unresolved%0A
     

Fix eslint-disable for unresolved messages line