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

19 lines
417 B
JavaScript
Raw Normal View History

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