forked from open-v2x/omega
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
41 lines (39 loc) · 1004 Bytes
/
Gruntfile.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
module.exports = function (grunt) {
grunt.initConfig({
i18next: {
dev: {
src: ['src/**/*.{tsx,ts}'],
dest: 'src',
options: {
lngs: ['en-US', 'zh-CN'],
removeUnusedKeys: true,
// sort: true,
keySeparator: false,
nsSeparator: false,
interpolation: {
prefix: '{{',
suffix: '}}',
},
resource: {
loadPath: 'src/locales/{{lng}}.json',
savePath: 'locales/{{lng}}.json',
},
func: {
list: ['t', 't.html'],
extensions: ['.ts', '.tsx'],
},
defaultValue: (lng, ns, key) => {
if (lng === 'zh-CN') {
return '';
}
return key;
},
},
},
},
});
// Load the plugin that provides the "i18next" task.
grunt.loadNpmTasks('i18next-scanner');
// Default task(s).
grunt.registerTask('default', ['i18next']);
};