Skip to content

Commit 63e0d21

Browse files
committed
update the CLI of yarn trans
1 parent 0b4097a commit 63e0d21

File tree

10 files changed

+98
-418
lines changed

10 files changed

+98
-418
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ test_node_env/node_modules
1313
.env
1414
*.icloud
1515

16-
/xml_*
16+
/xml_*
17+
/logs

dictionary/short.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

i18n/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
/node_modules
1+
/node_modules
2+
/translation_output

i18n/ai_files/zh_CN/dictionary.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
function: 函数
File renamed without changes.

i18n/controllers/gitComm.ts

Lines changed: 0 additions & 57 deletions
This file was deleted.

i18n/controllers/recurTranslate.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,19 @@ async function translate(langCode: string, filePath: string): Promise<void> {
8181
try {
8282
// Use the provided file path directly without modification
8383
const input_path = filePath;
84-
const language = languageNames.of(langCode);
84+
const language = languageNames.of(langCode.replace('_', '-'));
8585

8686
if (language === undefined) {
8787
throw new Error('Undefined language');
8888
}
8989

90-
if (!troubleshoot) assistant = await createAssistant(language, ai as any);
90+
if (!troubleshoot) assistant = await createAssistant(langCode, ai as any);
9191

92-
93-
// Generate output path by replacing "/en/" with "/cn/" in the path
92+
// Generate output path by replacing "/en/" with "/../i18n/translation_output/zh_CN/" in the path
9493
const output_path = filePath.replace(
9594
path.sep + "en" + path.sep,
96-
path.sep + langCode + path.sep
95+
path.sep + ".." + path.sep + "i18n" + path.sep + "translation_output" + path.sep + langCode + path.sep
9796
);
98-
99-
10097

10198
const translated: string = await recursivelyTranslate(
10299
language,

i18n/controllers/translate.ts

Lines changed: 0 additions & 250 deletions
This file was deleted.

0 commit comments

Comments
 (0)