summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-core/src/components/I18nProvider.js
blob: 32fa4a004d1f9b91876b82660551b000a457f694 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const React = require('react');
const intl = require('react-intl');
const ReactRedux = require('react-redux');

const I18nProvider = React.createClass({
    propTypes: {
        children: React.PropTypes.node
    },

    render() {
        // TODO
        const messages = {};

        return (
            <intl.IntlProvider locale={'en'} messages={messages}>
                {this.props.children}
            </intl.IntlProvider>
        );
    }
});

const mapStateToProps = state => {
    return { messages: state.i18n.messages };
};

module.exports = ReactRedux.connect(mapStateToProps)(I18nProvider);