diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-16 17:20:52 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-16 17:20:52 +0100 |
commit | 01e43c3e5799b575a70798056945365ddf51f3ad (patch) | |
tree | 75801dd3733930cc05cd3c26795cef382a4c1e5d /app/assets/javascripts/components/containers | |
parent | 546c4718e781f8900ba6498307ccb1e659de5edd (diff) |
Adding react-intl i18n to the frontend. No translations yet
Diffstat (limited to 'app/assets/javascripts/components/containers')
-rw-r--r-- | app/assets/javascripts/components/containers/mastodon.jsx | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/app/assets/javascripts/components/containers/mastodon.jsx b/app/assets/javascripts/components/containers/mastodon.jsx index 20b57998a..dbc32076b 100644 --- a/app/assets/javascripts/components/containers/mastodon.jsx +++ b/app/assets/javascripts/components/containers/mastodon.jsx @@ -32,6 +32,7 @@ import Following from '../features/following'; import Reblogs from '../features/reblogs'; import Favourites from '../features/favourites'; import HashtagTimeline from '../features/hashtag_timeline'; +import { IntlProvider } from 'react-intl'; const store = configureStore(); @@ -44,7 +45,8 @@ const Mastodon = React.createClass({ propTypes: { token: React.PropTypes.string.isRequired, timelines: React.PropTypes.object, - account: React.PropTypes.string + account: React.PropTypes.string, + locale: React.PropTypes.string.isRequired }, mixins: [PureRenderMixin], @@ -81,30 +83,34 @@ const Mastodon = React.createClass({ }, render () { + const { locale } = this.props; + return ( - <Provider store={store}> - <Router history={browserHistory} render={applyRouterMiddleware(useScroll())}> - <Route path='/' component={UI}> - <IndexRoute component={GettingStarted} /> - - <Route path='timelines/home' component={HomeTimeline} /> - <Route path='timelines/mentions' component={MentionsTimeline} /> - <Route path='timelines/public' component={PublicTimeline} /> - <Route path='timelines/tag/:id' component={HashtagTimeline} /> - - <Route path='statuses/new' component={Compose} /> - <Route path='statuses/:statusId' component={Status} /> - <Route path='statuses/:statusId/reblogs' component={Reblogs} /> - <Route path='statuses/:statusId/favourites' component={Favourites} /> - - <Route path='accounts/:accountId' component={Account}> - <IndexRoute component={AccountTimeline} /> - <Route path='followers' component={Followers} /> - <Route path='following' component={Following} /> + <IntlProvider locale={locale}> + <Provider store={store}> + <Router history={browserHistory} render={applyRouterMiddleware(useScroll())}> + <Route path='/' component={UI}> + <IndexRoute component={GettingStarted} /> + + <Route path='timelines/home' component={HomeTimeline} /> + <Route path='timelines/mentions' component={MentionsTimeline} /> + <Route path='timelines/public' component={PublicTimeline} /> + <Route path='timelines/tag/:id' component={HashtagTimeline} /> + + <Route path='statuses/new' component={Compose} /> + <Route path='statuses/:statusId' component={Status} /> + <Route path='statuses/:statusId/reblogs' component={Reblogs} /> + <Route path='statuses/:statusId/favourites' component={Favourites} /> + + <Route path='accounts/:accountId' component={Account}> + <IndexRoute component={AccountTimeline} /> + <Route path='followers' component={Followers} /> + <Route path='following' component={Following} /> + </Route> </Route> - </Route> - </Router> - </Provider> + </Router> + </Provider> + </IntlProvider> ); } |