Last active
July 1, 2018 00:50
-
-
Save ryandrewjohnson/2e222d5a12a4598b827a8ffeef968174 to your computer and use it in GitHub Desktop.
react-localize-redux - setLanguages.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import { renderToStaticMarkup } from "react-dom/server"; | |
| import { withLocalize } from "react-localize-redux"; | |
| import globalTranslations from "./translations/global.json"; | |
| class Main extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.props.initialize({ | |
| languages: [ | |
| { name: "English", code: "en" }, | |
| { name: "French", code: "fr" } | |
| ], | |
| translation: globalTranslations, | |
| options: { renderToStaticMarkup } | |
| }); | |
| } | |
| render() { | |
| // render Main layout component | |
| } | |
| } | |
| export default withLocalize(Main); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment