Created
February 16, 2020 09:27
-
-
Save tariqulislam/00fe15d81765c5a4901217b41d958b8d to your computer and use it in GitHub Desktop.
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 'i18next' | |
| import LanguageDetector from "i18next-browser-languagedetector" | |
| import {initReactI18next} from 'react-i18next' | |
| import XHR from 'i18next-xhr-backend' | |
| import languageEN from './locate/en/translate.json' | |
| import languageJP from './locate/jp/translate.json' | |
| i18n | |
| .use(XHR) | |
| .use(LanguageDetector) | |
| .use(initReactI18next) | |
| .init({ | |
| resources: { | |
| en: languageEN, | |
| jp: languageJP | |
| }, | |
| /* default language when load the website in browser */ | |
| lng: "en", | |
| /* When react i18next not finding any language to as default in borwser */ | |
| fallbackLng: "en", | |
| /* debugger For Development environment */ | |
| debug: true, | |
| ns: ["translations"], | |
| defaultNS: "translations", | |
| keySeparator: ".", | |
| interpolation: { | |
| escapeValue: false, | |
| formatSeparator: "," | |
| }, | |
| react: { | |
| wait: true, | |
| bindI18n: 'languageChanged loaded', | |
| bindStore: 'added removed', | |
| nsMode: 'default' | |
| } | |
| }) | |
| export default i18n; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment