mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
fb030353fe
refs https://github.com/TryGhost/Ghost/issues/15502 - plain JSON files are cleaner and less overwhelming than boilerplate JS files, and given they're going to be automatically generated, we probably won't be able to support comments anyway
28 lines
649 B
JavaScript
28 lines
649 B
JavaScript
const i18next = require('i18next');
|
|
|
|
module.exports = (lng = 'en') => {
|
|
const i18nextInstance = i18next.createInstance();
|
|
i18nextInstance.init({
|
|
lng,
|
|
debug: process.env.NODE_ENV === 'development',
|
|
|
|
// allow keys to be phrases having `:`, `.`
|
|
nsSeparator: false,
|
|
keySeparator: false,
|
|
|
|
// do not load a fallback
|
|
fallbackLng: false,
|
|
|
|
resources: {
|
|
en: {
|
|
translation: require('../locales/en.json')
|
|
},
|
|
nl: {
|
|
translation: require('../locales/nl.json')
|
|
}
|
|
}
|
|
});
|
|
|
|
return i18nextInstance;
|
|
};
|