ztxkutils 2.10.66-30 → 2.10.66-32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/print.js +17 -8
- package/package.json +1 -1
- package/zti18n-cli/bin/index.js +3 -3
- package/zti18n-cli/index.js +23 -23
- package/zti18n-cli/src/command/collect.js +353 -353
- package/zti18n-cli/src/command/convert.js +17 -17
- package/zti18n-cli/src/command/convert2.js +35 -35
- package/zti18n-cli/src/command/initFileConf.js +133 -133
- package/zti18n-cli/src/command/publish.js +24 -24
- package/zti18n-cli/src/conf/BaseConf.js +21 -21
- package/zti18n-cli/src/conf/FileConf.js +116 -116
- package/zti18n-cli/src/index.js +75 -75
- package/zti18n-cli/src/translate/google.js +87 -87
- package/zti18n-cli/src/utils/isChinese.js +3 -3
- package/zti18n-cli/src/utils/log.js +8 -8
- package/zti18n-cli/src/utils/mergeOptions.js +45 -45
- package/zti18n-cli/src/utils/reactOptions.js +73 -73
- package/zti18n-cli/src/utils/vueOptions.js +69 -69
- package/zti18n-core/index.js +1 -1
- package/zti18n-core/src/index.js +5 -5
- package/zti18n-core/src/plugin/reactIntlToReactIntlUniversal.js +224 -224
- package/zti18n-core/src/plugin/reactIntlUniversalToDi18n.js +64 -64
- package/zti18n-core/src/transform/defaultPkMap.js +79 -79
- package/zti18n-core/src/transform/transformHtml.js +271 -271
- package/zti18n-core/src/transform/transformJs.js +489 -489
- package/zti18n-core/src/transform/transformPug.js +272 -272
- package/zti18n-core/src/transform/transformReactIntlToReactIntlUniversal.js +96 -96
- package/zti18n-core/src/transform/transformReactIntlUniveralToDi18n.js +90 -90
- package/zti18n-core/src/transform/transformToDi18n.js +22 -22
- package/zti18n-core/src/transform/transformTs.js +41 -41
- package/zti18n-core/src/transform/transformVue.js +126 -126
- package/zti18n-core/src/transform/transformZeroToDi18n.js +105 -105
- package/zti18n-core/src/translate/google.js +6 -6
- package/zti18n-core/src/utils/constants.js +3 -3
- package/zti18n-core/src/utils/getIgnoreLines.js +14 -14
- package/zti18n-core/src/utils/isChinese.js +3 -3
- package/zti18n-core/src/utils/log.js +8 -8
- package/dist/dataModel-1fbaff40.js +0 -24
- package/dist/dataModel-6c68c88f.js +0 -26
- package/dist/dataModel-914b6226.js +0 -26
- package/dist/dataModel-b3629ef3.js +0 -26
- package/dist/reqUrl-22b880a4.js +0 -82
- package/dist/request-1e442d5d.js +0 -2982
- package/dist/request-4c29d6de.js +0 -2977
- package/dist/request-80d1ac80.js +0 -2992
- package/dist/request-986d7090.js +0 -2923
- package/dist/request-c0970aae.js +0 -2917
- package/dist/request-d1972b41.js +0 -2992
- package/dist/request-d8d72b87.js +0 -2982
- package/dist/request-f600ad7a.js +0 -2992
- package/dist/tools-16a7fb45.js +0 -2446
- package/dist/validate-18e52490.js +0 -249
- package/dist/validate-21164759.js +0 -260
- package/dist/validate-21b58a69.js +0 -260
- package/dist/validate-2de5a28f.js +0 -260
- package/dist/validate-ab47ebe9.js +0 -260
@@ -1,73 +1,73 @@
|
|
1
|
-
// default options
|
2
|
-
module.exports = {
|
3
|
-
// source path, <string array>
|
4
|
-
// e.g. ['src']
|
5
|
-
entry: ['src'],
|
6
|
-
|
7
|
-
// exclude pattern, <string array>
|
8
|
-
// e.g. ['**/dist/**', '**/*.config.js', '**/*.data.js']
|
9
|
-
exclude: [],
|
10
|
-
|
11
|
-
// output path, <string array>
|
12
|
-
// e.g. ['dist']
|
13
|
-
output: ['src'], // default i18n in place
|
14
|
-
|
15
|
-
// auto translate flag, <boolean>
|
16
|
-
// e.g. true
|
17
|
-
disableAutoTranslate: true,
|
18
|
-
|
19
|
-
// only extract locales, not touch source code, <boolean>
|
20
|
-
// e.g. true
|
21
|
-
extractOnly: false,
|
22
|
-
|
23
|
-
// translator, <null | string>
|
24
|
-
// null: default google translator
|
25
|
-
// e.g. ../translate/google.js
|
26
|
-
translator: null,
|
27
|
-
|
28
|
-
// ignored components, <string array>
|
29
|
-
// e.g. ['EventTracker']
|
30
|
-
ignoreComponents: [],
|
31
|
-
|
32
|
-
// ignored methods, <string array>
|
33
|
-
// e.g. ['MirrorTrack']
|
34
|
-
ignoreMethods: [],
|
35
|
-
|
36
|
-
// XXX: json loose
|
37
|
-
// primaryRegx: /[\u4e00-\u9fa5]/,
|
38
|
-
|
39
|
-
// primary locale, <string>
|
40
|
-
// e.g. 'zh-CN'
|
41
|
-
primaryLocale: 'zh-CN',
|
42
|
-
|
43
|
-
// supported locales, <string array>
|
44
|
-
// e.g. ['zh-CN', 'en-US']
|
45
|
-
supportedLocales: ['zh-CN', 'en-US'],
|
46
|
-
|
47
|
-
// import codes, <string>
|
48
|
-
importCode: "import i18next from 'ztxkutils/dist/i18next';",
|
49
|
-
|
50
|
-
// i18n object, <string>
|
51
|
-
// e.g. 'intl'
|
52
|
-
i18nObject: 'i18next',
|
53
|
-
|
54
|
-
// i18n method, <string>
|
55
|
-
// e.g. 't'
|
56
|
-
i18nMethod: 't',
|
57
|
-
|
58
|
-
// prettier conf, <null | object>
|
59
|
-
// e.g. {}
|
60
|
-
prettier: {
|
61
|
-
singleQuote: true,
|
62
|
-
trailingComma: 'es5',
|
63
|
-
endOfLine: 'lf',
|
64
|
-
},
|
65
|
-
|
66
|
-
// i18n saving conf, <object>
|
67
|
-
// if localeConf.type !== 'file', localeConf.path is required
|
68
|
-
// e.g. { type: 'apollo', path: '../conf/ApolloConf.js', ... }
|
69
|
-
localeConf: {
|
70
|
-
type: 'file',
|
71
|
-
// others...
|
72
|
-
},
|
73
|
-
};
|
1
|
+
// default options
|
2
|
+
module.exports = {
|
3
|
+
// source path, <string array>
|
4
|
+
// e.g. ['src']
|
5
|
+
entry: ['src'],
|
6
|
+
|
7
|
+
// exclude pattern, <string array>
|
8
|
+
// e.g. ['**/dist/**', '**/*.config.js', '**/*.data.js']
|
9
|
+
exclude: [],
|
10
|
+
|
11
|
+
// output path, <string array>
|
12
|
+
// e.g. ['dist']
|
13
|
+
output: ['src'], // default i18n in place
|
14
|
+
|
15
|
+
// auto translate flag, <boolean>
|
16
|
+
// e.g. true
|
17
|
+
disableAutoTranslate: true,
|
18
|
+
|
19
|
+
// only extract locales, not touch source code, <boolean>
|
20
|
+
// e.g. true
|
21
|
+
extractOnly: false,
|
22
|
+
|
23
|
+
// translator, <null | string>
|
24
|
+
// null: default google translator
|
25
|
+
// e.g. ../translate/google.js
|
26
|
+
translator: null,
|
27
|
+
|
28
|
+
// ignored components, <string array>
|
29
|
+
// e.g. ['EventTracker']
|
30
|
+
ignoreComponents: [],
|
31
|
+
|
32
|
+
// ignored methods, <string array>
|
33
|
+
// e.g. ['MirrorTrack']
|
34
|
+
ignoreMethods: [],
|
35
|
+
|
36
|
+
// XXX: json loose
|
37
|
+
// primaryRegx: /[\u4e00-\u9fa5]/,
|
38
|
+
|
39
|
+
// primary locale, <string>
|
40
|
+
// e.g. 'zh-CN'
|
41
|
+
primaryLocale: 'zh-CN',
|
42
|
+
|
43
|
+
// supported locales, <string array>
|
44
|
+
// e.g. ['zh-CN', 'en-US']
|
45
|
+
supportedLocales: ['zh-CN', 'en-US'],
|
46
|
+
|
47
|
+
// import codes, <string>
|
48
|
+
importCode: "import i18next from 'ztxkutils/dist/i18next';",
|
49
|
+
|
50
|
+
// i18n object, <string>
|
51
|
+
// e.g. 'intl'
|
52
|
+
i18nObject: 'i18next',
|
53
|
+
|
54
|
+
// i18n method, <string>
|
55
|
+
// e.g. 't'
|
56
|
+
i18nMethod: 't',
|
57
|
+
|
58
|
+
// prettier conf, <null | object>
|
59
|
+
// e.g. {}
|
60
|
+
prettier: {
|
61
|
+
singleQuote: true,
|
62
|
+
trailingComma: 'es5',
|
63
|
+
endOfLine: 'lf',
|
64
|
+
},
|
65
|
+
|
66
|
+
// i18n saving conf, <object>
|
67
|
+
// if localeConf.type !== 'file', localeConf.path is required
|
68
|
+
// e.g. { type: 'apollo', path: '../conf/ApolloConf.js', ... }
|
69
|
+
localeConf: {
|
70
|
+
type: 'file',
|
71
|
+
// others...
|
72
|
+
},
|
73
|
+
};
|
@@ -1,69 +1,69 @@
|
|
1
|
-
// default options
|
2
|
-
module.exports = {
|
3
|
-
// source path, <string array>
|
4
|
-
// e.g. ['src']
|
5
|
-
entry: ['src'],
|
6
|
-
|
7
|
-
// exclude pattern, <string array>
|
8
|
-
// e.g. ['**/dist/**', '**/*.config.js', '**/*.data.js']
|
9
|
-
exclude: [],
|
10
|
-
|
11
|
-
// output path, <string array>
|
12
|
-
// e.g. ['dist']
|
13
|
-
output: ['src'], // default i18n in place
|
14
|
-
|
15
|
-
// auto translate flag, <boolean>
|
16
|
-
// e.g. true
|
17
|
-
disableAutoTranslate: true,
|
18
|
-
|
19
|
-
// only extract locales, not touch source code, <boolean>
|
20
|
-
// e.g. true
|
21
|
-
extractOnly: false,
|
22
|
-
|
23
|
-
// translator, <null | string>
|
24
|
-
// null: default google translator
|
25
|
-
// e.g. ../translate/google.js
|
26
|
-
translator: null,
|
27
|
-
|
28
|
-
// ignored components, <string array>
|
29
|
-
// e.g. ['EventTracker']
|
30
|
-
ignoreComponents: [],
|
31
|
-
|
32
|
-
// ignored methods, <string array>
|
33
|
-
// e.g. ['MirrorTrack']
|
34
|
-
ignoreMethods: [],
|
35
|
-
|
36
|
-
// XXX: json loose
|
37
|
-
// primaryRegx: /[\u4e00-\u9fa5]/,
|
38
|
-
|
39
|
-
// primary locale, <string>
|
40
|
-
// e.g. 'zh-CN'
|
41
|
-
primaryLocale: 'zh-CN',
|
42
|
-
|
43
|
-
// supported locales, <string array>
|
44
|
-
// e.g. ['zh-CN', 'en-US']
|
45
|
-
supportedLocales: ['zh-CN', 'en-US'],
|
46
|
-
|
47
|
-
// import codes, <string>
|
48
|
-
importCode: "import { intl } from 'di18n-vue';",
|
49
|
-
|
50
|
-
// i18n object, <string>
|
51
|
-
// e.g. 'intl'
|
52
|
-
i18nObject: 'intl',
|
53
|
-
|
54
|
-
// i18n method, <string>
|
55
|
-
// e.g. '$t'
|
56
|
-
i18nMethod: '$t',
|
57
|
-
|
58
|
-
// prettier conf, <null | object>
|
59
|
-
// e.g. {}
|
60
|
-
prettier: null,
|
61
|
-
|
62
|
-
// i18n saving conf, <object>
|
63
|
-
// if localeConf.type !== 'file', localeConf.path is required
|
64
|
-
// e.g. { type: 'apollo', path: '../conf/ApolloConf.js', ... }
|
65
|
-
localeConf: {
|
66
|
-
type: 'file',
|
67
|
-
// others...
|
68
|
-
},
|
69
|
-
};
|
1
|
+
// default options
|
2
|
+
module.exports = {
|
3
|
+
// source path, <string array>
|
4
|
+
// e.g. ['src']
|
5
|
+
entry: ['src'],
|
6
|
+
|
7
|
+
// exclude pattern, <string array>
|
8
|
+
// e.g. ['**/dist/**', '**/*.config.js', '**/*.data.js']
|
9
|
+
exclude: [],
|
10
|
+
|
11
|
+
// output path, <string array>
|
12
|
+
// e.g. ['dist']
|
13
|
+
output: ['src'], // default i18n in place
|
14
|
+
|
15
|
+
// auto translate flag, <boolean>
|
16
|
+
// e.g. true
|
17
|
+
disableAutoTranslate: true,
|
18
|
+
|
19
|
+
// only extract locales, not touch source code, <boolean>
|
20
|
+
// e.g. true
|
21
|
+
extractOnly: false,
|
22
|
+
|
23
|
+
// translator, <null | string>
|
24
|
+
// null: default google translator
|
25
|
+
// e.g. ../translate/google.js
|
26
|
+
translator: null,
|
27
|
+
|
28
|
+
// ignored components, <string array>
|
29
|
+
// e.g. ['EventTracker']
|
30
|
+
ignoreComponents: [],
|
31
|
+
|
32
|
+
// ignored methods, <string array>
|
33
|
+
// e.g. ['MirrorTrack']
|
34
|
+
ignoreMethods: [],
|
35
|
+
|
36
|
+
// XXX: json loose
|
37
|
+
// primaryRegx: /[\u4e00-\u9fa5]/,
|
38
|
+
|
39
|
+
// primary locale, <string>
|
40
|
+
// e.g. 'zh-CN'
|
41
|
+
primaryLocale: 'zh-CN',
|
42
|
+
|
43
|
+
// supported locales, <string array>
|
44
|
+
// e.g. ['zh-CN', 'en-US']
|
45
|
+
supportedLocales: ['zh-CN', 'en-US'],
|
46
|
+
|
47
|
+
// import codes, <string>
|
48
|
+
importCode: "import { intl } from 'di18n-vue';",
|
49
|
+
|
50
|
+
// i18n object, <string>
|
51
|
+
// e.g. 'intl'
|
52
|
+
i18nObject: 'intl',
|
53
|
+
|
54
|
+
// i18n method, <string>
|
55
|
+
// e.g. '$t'
|
56
|
+
i18nMethod: '$t',
|
57
|
+
|
58
|
+
// prettier conf, <null | object>
|
59
|
+
// e.g. {}
|
60
|
+
prettier: null,
|
61
|
+
|
62
|
+
// i18n saving conf, <object>
|
63
|
+
// if localeConf.type !== 'file', localeConf.path is required
|
64
|
+
// e.g. { type: 'apollo', path: '../conf/ApolloConf.js', ... }
|
65
|
+
localeConf: {
|
66
|
+
type: 'file',
|
67
|
+
// others...
|
68
|
+
},
|
69
|
+
};
|
package/zti18n-core/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
module.exports = require('./src');
|
1
|
+
module.exports = require('./src');
|
package/zti18n-core/src/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
exports.transformReactIntlToReactIntlUniversal = require('./transform/transformReactIntlToReactIntlUniversal');
|
2
|
-
exports.transformReactIntlUniveralToDi18n = require('./transform/transformReactIntlUniveralToDi18n');
|
3
|
-
exports.transformZeroToDi18n = require('./transform/transformZeroToDi18n');
|
4
|
-
exports.transformToDi18n = require('./transform/transformToDi18n');
|
5
|
-
exports.googleTranslate = require('./translate/google');
|
1
|
+
exports.transformReactIntlToReactIntlUniversal = require('./transform/transformReactIntlToReactIntlUniversal');
|
2
|
+
exports.transformReactIntlUniveralToDi18n = require('./transform/transformReactIntlUniveralToDi18n');
|
3
|
+
exports.transformZeroToDi18n = require('./transform/transformZeroToDi18n');
|
4
|
+
exports.transformToDi18n = require('./transform/transformToDi18n');
|
5
|
+
exports.googleTranslate = require('./translate/google');
|