i18-fe-automator-beta 1.0.0 → 1.0.2
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/commonjs/index.js +5 -5
- package/dist/esm/index.mjs +5 -5
- package/package.json +1 -1
package/dist/commonjs/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var stripAnsi = require('strip-ansi');
|
|
|
23
23
|
require('shelljs');
|
|
24
24
|
var process$1 = require('child_process');
|
|
25
25
|
var _ = require('lodash');
|
|
26
|
-
|
|
26
|
+
require('nanoid');
|
|
27
27
|
var request$1 = require('request-promise');
|
|
28
28
|
require('os');
|
|
29
29
|
require('console');
|
|
@@ -1724,7 +1724,7 @@ async function lint$1(patterns, fix, rule, hook = {}) {
|
|
|
1724
1724
|
.then(({ isTransKey }) => {
|
|
1725
1725
|
if (isTransKey) {
|
|
1726
1726
|
console.log(chalk.green(`开始准备翻译...`));
|
|
1727
|
-
process$1.execSync(`fe-it-
|
|
1727
|
+
process$1.execSync(`fe-it-beta --fix -i ${patterns} `, {
|
|
1728
1728
|
stdio: "inherit", // 打印子进程的输出到父进程
|
|
1729
1729
|
});
|
|
1730
1730
|
}
|
|
@@ -2270,7 +2270,7 @@ function translateUtil(appid, key, projectName, isLintFix) {
|
|
|
2270
2270
|
const s = str.split(" ");
|
|
2271
2271
|
let key = s
|
|
2272
2272
|
.map((item, index) => {
|
|
2273
|
-
return item[0].toUpperCase() + item.slice(1);
|
|
2273
|
+
return item?( item[0].toUpperCase() + item.slice(1)):item;
|
|
2274
2274
|
})
|
|
2275
2275
|
.join("");
|
|
2276
2276
|
// 去除key中的标点符号
|
|
@@ -2279,8 +2279,8 @@ function translateUtil(appid, key, projectName, isLintFix) {
|
|
|
2279
2279
|
EN = EN[0].toUpperCase() + EN.slice(1);
|
|
2280
2280
|
item1.EN = EN;
|
|
2281
2281
|
if (isLintFix) {
|
|
2282
|
-
item1.key = nanoid
|
|
2283
|
-
|
|
2282
|
+
// item1.key = nanoid().replace("_", "a");
|
|
2283
|
+
item1.key = id + "-" + key;
|
|
2284
2284
|
} else {
|
|
2285
2285
|
item1.key = id + "-" + key;
|
|
2286
2286
|
}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -21,7 +21,7 @@ import stripAnsi from 'strip-ansi';
|
|
|
21
21
|
import 'shelljs';
|
|
22
22
|
import process$1 from 'child_process';
|
|
23
23
|
import _ from 'lodash';
|
|
24
|
-
import
|
|
24
|
+
import 'nanoid';
|
|
25
25
|
import request$1 from 'request-promise';
|
|
26
26
|
import 'os';
|
|
27
27
|
import 'console';
|
|
@@ -1702,7 +1702,7 @@ async function lint$1(patterns, fix, rule, hook = {}) {
|
|
|
1702
1702
|
.then(({ isTransKey }) => {
|
|
1703
1703
|
if (isTransKey) {
|
|
1704
1704
|
console.log(chalk.green(`开始准备翻译...`));
|
|
1705
|
-
process$1.execSync(`fe-it-
|
|
1705
|
+
process$1.execSync(`fe-it-beta --fix -i ${patterns} `, {
|
|
1706
1706
|
stdio: "inherit", // 打印子进程的输出到父进程
|
|
1707
1707
|
});
|
|
1708
1708
|
}
|
|
@@ -2248,7 +2248,7 @@ function translateUtil(appid, key, projectName, isLintFix) {
|
|
|
2248
2248
|
const s = str.split(" ");
|
|
2249
2249
|
let key = s
|
|
2250
2250
|
.map((item, index) => {
|
|
2251
|
-
return item[0].toUpperCase() + item.slice(1);
|
|
2251
|
+
return item?( item[0].toUpperCase() + item.slice(1)):item;
|
|
2252
2252
|
})
|
|
2253
2253
|
.join("");
|
|
2254
2254
|
// 去除key中的标点符号
|
|
@@ -2257,8 +2257,8 @@ function translateUtil(appid, key, projectName, isLintFix) {
|
|
|
2257
2257
|
EN = EN[0].toUpperCase() + EN.slice(1);
|
|
2258
2258
|
item1.EN = EN;
|
|
2259
2259
|
if (isLintFix) {
|
|
2260
|
-
item1.key = nanoid().replace("_", "a");
|
|
2261
|
-
|
|
2260
|
+
// item1.key = nanoid().replace("_", "a");
|
|
2261
|
+
item1.key = id + "-" + key;
|
|
2262
2262
|
} else {
|
|
2263
2263
|
item1.key = id + "-" + key;
|
|
2264
2264
|
}
|