Created
August 29, 2020 20:18
-
-
Save maxgfr/6db80be2fa07dead5ebb5f93744b0477 to your computer and use it in GitHub Desktop.
basic configuration for react-js using i18n library
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 i18n from 'i18n-js'; | |
| import detectBrowserLanguage from 'detect-browser-language'; | |
| const en = { | |
| title: "Title" | |
| }; | |
| const fr = { | |
| title: "Title" | |
| }; | |
| i18n.defaultLocale = 'en'; | |
| i18n.fallbacks = true; | |
| i18n.translations = { | |
| fr, | |
| en | |
| }; | |
| i18n.locale = detectBrowserLanguage(); | |
| export default i18n; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment