forked from jasonkneen/ti-i18n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
104 lines (98 loc) · 2.68 KB
/
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
var showedBanner = false;
exports.package = require('./package.json');
exports.commands = {
extract: {
desc: 'extract i18n strings from JS, TSS and XML files',
options: {
'project-dir': {
abbr: 'd',
desc: 'Project directory (default: current)',
hint: 'path'
},
language: {
abbr: 'l',
desc: 'single language to compare with and write to (default: all)',
hint: 'ln'
}
},
flags: {
apply: {
abbr: 'a',
desc: 'append to the strings.xml files (default: no)'
}
}
},
sync: {
desc: 'sync strings between all languages',
options: {
'project-dir': {
abbr: 'd',
desc: 'Project directory (default: current)',
hint: 'path'
}
},
flags: {
apply: {
abbr: 'a',
desc: 'append to the strings.xml files (default: no)'
}
}
},
sort: {
desc: 'sort strings by key',
options: {
'project-dir': {
abbr: 'd',
desc: 'Project directory (default: current)',
hint: 'path'
}
}
},
merge: {
desc: 'merge (translated) strings file with given or default language',
options: {
'project-dir': {
abbr: 'd',
desc: 'Project directory (default: current)',
hint: 'path'
},
source: {
abbr: 's',
desc: 'Source strings.xml file to merge from',
hint: 'path'
},
language: {
abbr: 'l',
desc: 'language to compare with and merge to',
hint: 'ln'
}
},
flags: {
apply: {
abbr: 'a',
desc: 'overwrite the strings.xml file (default: no)'
}
}
},
plug: {
ti: false,
desc: 'plug ti-i18n into Titanium CLI as: ti i18n'
},
unplug: {
desc: 'unplug ti-i18n from Titanium CLI'
},
plugged: {
ti: false,
desc: 'check if ti-i18n is plugged into Titanium CLI'
}
};
exports.banner = function(whitespace) {
if (!showedBanner) {
console.log(exports.package.about.name.cyan.bold + ', version ' + exports.package.version);
console.log(exports.package.about.copyright);
if (whitespace !== false) {
console.log('');
}
showedBanner = true;
}
};