-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathi18next-scanner.config.js
More file actions
53 lines (52 loc) · 1.33 KB
/
i18next-scanner.config.js
File metadata and controls
53 lines (52 loc) · 1.33 KB
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
var flush = require("./i18next-scanner");
var typescriptTransform = require("i18next-scanner-typescript");
module.exports = {
input: ["src/**/*.{js,jsx,ts,tsx}"],
removeUnusedKeys: true,
sort: true,
output: "./src",
options: {
contextFallback: false,
sort: true,
func: {
list: ["t", "i18next.t", "i18n.t"],
extensions: [".js", ".jsx"],
},
trans: {
component: "Trans",
i18nKey: "i18nKey",
defaultsKey: false,
extensions: [".js", ".jsx"],
acorn: {
ecmaVersion: 2020,
sourceType: "module", // defaults to 'module'
// Check out https://github.com/acornjs/acorn/tree/master/acorn#interface for additional options
},
},
lngs: ["en", "it", "es", "fr"],
ns: ["links", "translation"],
defaultLng: "en",
defaultNs: "translation",
defaultValue: "",
resource: {
loadPath: "locales/{{lng}}/{{ns}}.json",
savePath: "locales/{{lng}}/{{ns}}.json",
jsonIndent: 2,
lineEnding: "auto",
},
nsSeparator: false, // namespace separator
keySeparator: ":::", // key separator
interpolation: {
prefix: "{{",
suffix: "}}",
},
},
transform: typescriptTransform({
// default value for extensions
extensions: [".tsx", ".ts"],
tsOptions: {
target: "es2017",
},
}),
flush,
};