-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathi18next-scanner.config.js
54 lines (52 loc) · 1.2 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
47
48
49
50
51
52
53
54
var fs = require('fs');
const languages = require('./src/data/languages');
module.exports = {
input: [
"src/**/*.{js,jsx}",
// Use ! to filter out files or directories
"!src/**/*.spec.{js,jsx}",
"!src/locales/**",
"!**/node_modules/**",
],
output: "./",
options: {
debug: false,
removeUnusedKeys: false,
sort: false,
attr: {
list: ["data-i18n"],
extensions: [".html", ".htm"],
},
func: {
list: ["i18next.t", "i18n.t", "t"],
extensions: [".js", ".jsx"],
},
trans: {
component: "Trans",
i18nKey: "i18nKey",
defaultsKey: "defaults",
extensions: [".js", ".jsx"],
fallbackKey: false,
},
lngs: languages.langs,
ns: ["translation"],
defaultLng: languages.defaultLangKey,
defaultNs: "translation",
defaultValue: "",
resource: {
loadPath: "src/locales/{{lng}}/{{ns}}.json",
savePath: "src/locales/{{lng}}/{{ns}}.json",
jsonIndent: 2,
lineEnding: "\n",
},
nsSeparator: false,
keySeparator: false,
pluralSeparator: "_",
contextSeparator: "_",
contextDefaultValues: [],
interpolation: {
prefix: "{{",
suffix: "}}",
},
},
}