i18next.option.js 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. module.exports = {
  2. debug: true,
  3. removeUnusedKeys: true,
  4. func: {
  5. list: ['t', 'props.t', 'this.props.t'],
  6. extensions: ['.js', '.jsx']
  7. },
  8. lngs: ['en', 'fr'],
  9. defaultLng: 'en',
  10. keySeparator: false, // false means "keyBasedFallback"
  11. nsSeparator: false, // false means "keyBasedFallback"
  12. fallbackLng: false,
  13. ns: ['translation'], // namespace
  14. defaultNS: 'translation',
  15. // @param {string} lng The language currently used.
  16. // @param {string} ns The namespace currently used.
  17. // @param {string} key The translation key.
  18. // @return {string} Returns a default value for the translation key.
  19. // Return key as the default value for English language. Otherwise, returns '__NOT_TRANSLATED__'
  20. defaultValue: (lng, ns, key) => lng === 'en' ? key : '__NOT_TRANSLATED__',
  21. react: {wait: true},
  22. resource: {
  23. // The path where resources get loaded from.
  24. // /!\ /!\ /!\ Relative to CURRENT working directory. /!\
  25. loadPath: 'i18next.scanner/{{lng}}/{{ns}}.json',
  26. // The path to store resources.
  27. // /!\ /!\ /!\ Relative to the path specified by `vfs.dest('./i18next.scanner')`. /!\
  28. savePath: '{{lng}}/{{ns}}.json',
  29. jsonIndent: 2,
  30. lineEnding: '\n'
  31. },
  32. // interpolation: {
  33. // escapeValue: false, // not needed for react!!
  34. // },
  35. trans: false,
  36. }