i18n.js 743B

1234567891011121314151617181920212223242526272829303132
  1. import i18n from 'i18next'
  2. import { reactI18nextModule } from 'react-i18next'
  3. import { langFr, langEn } from 'tracim_lib'
  4. import fr from './translate/fr.js'
  5. import en from './translate/en.js'
  6. i18n
  7. .use(reactI18nextModule)
  8. .init({
  9. fallbackLng: 'fr',
  10. // have a common namespace used around the full app
  11. ns: ['translation'], // namespace
  12. defaultNS: 'translation',
  13. debug: true,
  14. // interpolation: {
  15. // escapeValue: false, // not needed for react!!
  16. // },
  17. react: {
  18. wait: true
  19. },
  20. resources: {
  21. en: {
  22. translation: {...langEn.translation, ...en.translation}
  23. },
  24. fr: {
  25. translation: {...langFr.translation, ...fr.translation}
  26. }
  27. }
  28. })
  29. export default i18n