-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathi18next-scanner.config.js
46 lines (46 loc) · 1.13 KB
/
i18next-scanner.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
module.exports = {
input: [
'src/**/*.{js,jsx}',
'pages/**/*.{js,jsx}'
],
output: './',
options: {
debug: true,
removeUnusedKeys: true,
func: {
list: ['t'],
extensions: ['.js', '.jsx']
},
trans: {
component: 'Trans',
i18nKey: 'i18nKey',
defaultsKey: 'defaults',
extensions: ['.js', '.jsx'],
fallbackKey: function (ns, value) {
return value
},
acorn: {
ecmaVersion: 10, // defaults to 10
sourceType: 'module' // defaults to 'module'
// Check out https://github.com/acornjs/acorn/tree/master/acorn#interface for additional options
}
},
lngs: ['en', 'pt', 'pt-BR'],
ns: [],
defaultLng: 'en',
defaultNs: 'common',
defaultValue: (language, namespace, key) => key,
resource: {
loadPath: 'public/static/locales/{{lng}}/{{ns}}.json',
savePath: 'public/static/locales/{{lng}}/{{ns}}.json',
jsonIndent: 2,
lineEnding: '\n'
},
nsSeparator: false, // namespace separator
keySeparator: false, // key separator
interpolation: {
prefix: '{{',
suffix: '}}'
}
}
}