Skip to content

Instantly share code, notes, and snippets.

@KennedyIhe
Created April 28, 2020 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KennedyIhe/b5bd2cb9a7a1d8606fc137df8712e380 to your computer and use it in GitHub Desktop.
Save KennedyIhe/b5bd2cb9a7a1d8606fc137df8712e380 to your computer and use it in GitHub Desktop.
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import Backend from 'i18next-xhr-backend';
i18n
.use(Backend)
.use(initReactI18next)
.init({
debug: true,
lng: 'en',
fallbackLng: 'en',
whitelist: ['en', 'es'],
interpolation: {
escapeValue: false,
},
backend: {
loadPath: 'src/translations/{{lng}}.json',
},
});
export default i18n;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment