add next-i18next as i18n framework

This commit is contained in:
myl7
2022-02-06 06:18:26 +08:00
parent afc691cee7
commit e28ce30987
10 changed files with 655 additions and 18 deletions
+26
View File
@@ -0,0 +1,26 @@
const path = require('path')
const { i18n, localePath } = require('./next-i18next.config')
module.exports = {
input: ['**/*.{ts,tsx}', '!**/node_modules/**'],
options: {
sort: true,
removeUnusedKeys: true,
func: {
list: ['t'],
extensions: ['.ts', '.tsx']
},
lngs: i18n.locales,
ns: ['common'],
defaultLng: i18n.defaultLocale,
defaultNs: 'common',
defaultValue: (lng, _ns, key) => (lng === i18n.defaultLocale ? key : ''),
resource: {
loadPath: path.join(localePath, '{{lng}}/{{ns}}.json'),
savePath: path.join(localePath, '{{lng}}/{{ns}}.json')
},
nsSeparator: false,
keySeparator: false
}
}