import Telescope from 'meteor/nova:lib'; import React, { PropTypes, Component } from 'react'; import { IntlProvider, intlShape} from 'react-intl'; import { withCurrentUser } from 'meteor/nova:users'; class App extends Component { getLocale() { return Telescope.settings.get("locale", "en"); } getChildContext() { const messages = Telescope.strings[this.getLocale()] || {}; const intlProvider = new IntlProvider({locale: this.getLocale()}, messages); const {intl} = intlProvider.getChildContext(); return { intl: intl }; } render() { return ( { this.props.loading ? : {this.props.children} } ) } } App.propTypes = { loading: React.PropTypes.bool, } App.childContextTypes = { intl: intlShape, } Telescope.registerComponent('App', App, withCurrentUser); export default App;