1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples/with-i18next/tools/startI18n.js
whphhg 8acdae66d7 Add support for fetching multiple translation files (#2743)
* Add support for fetching multiple translation files

* Cleanup
2017-08-13 02:28:20 +02:00

19 lines
417 B
JavaScript

import i18n from 'i18next'
/**
* Initialize a i18next instance.
* @function startI18n
* @param {object} files - Translation files.
* @param {string} lang - Active language.
*/
const startI18n = (files, lang) => i18n.init({
lng: lang, // active language http://i18next.com/translate/
fallbackLng: 'pt',
resources: files,
ns: ['common'],
defaultNS: 'common',
debug: false
})
export default startI18n