File tree 6 files changed +27
-17
lines changed
6 files changed +27
-17
lines changed Original file line number Diff line number Diff line change
1
+ /node_modules
Original file line number Diff line number Diff line change @@ -331,7 +331,7 @@ async function recursivelyTranslate(
331
331
If a term exists in the reference file, use that translation without deviation.
332
332
Do not modify XML tags, attributes of XML tags and structure. Do not say anything else.
333
333
Content to translate:
334
- ${ chunk } `
334
+ <TRANSLATE> ${ chunk } </TRANSLATE> `
335
335
} ) ;
336
336
const run = await ai . beta . threads . runs . createAndPoll ( thread . id , {
337
337
assistant_id : assistant_id
@@ -369,13 +369,13 @@ async function recursivelyTranslate(
369
369
370
370
clean . on ( "opentag" , node => {
371
371
currDepth ++ ;
372
- if ( node . name != "WRAPPER" ) {
372
+ if ( node . name != "WRAPPER" && node . name != "TRANSLATE" ) {
373
373
translatedChunk += `<${ node . name } ${ formatAttributes ( node . attributes ) } >` ;
374
374
}
375
375
} ) ;
376
376
377
377
clean . on ( "closetag" , tagName => {
378
- if ( tagName != "WRAPPER" ) {
378
+ if ( tagName != "WRAPPER" && tagName != "TRANSLATE" ) {
379
379
translatedChunk += `</${ tagName } >` ;
380
380
}
381
381
currDepth -- ;
Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ export default async function fancyName(path: string) {
11
11
( async ( ) => {
12
12
try {
13
13
await Promise . all ( [
14
- // fancyName("2")
15
- // fancyName("1.1"),
16
- // fancyName("1.1.2"),
17
- // fancyName("1.1.3"),
18
- // fancyName("1.1.4"),
19
- // fancyName("1.1.5"),
20
- fancyName ( "1.1.6" ) ,
21
- // fancyName("1.1.7")
14
+ // fancyName("2"),
15
+ fancyName ( "1.1" ) ,
16
+ fancyName ( "1.1.2" ) ,
17
+ fancyName ( "1.1.3" ) ,
18
+ fancyName ( "1.1.4" ) ,
19
+ fancyName ( "1.1.5" ) ,
20
+ // fancyName("1.1.6"),
21
+ // fancyName("1.1.7"),
22
22
// fancyName("1.1.8"),
23
23
// translate("Chinese", "1"),
24
24
] ) ;
Original file line number Diff line number Diff line change 11
11
}
12
12
],
13
13
"dependencies" : {
14
+ },
15
+ "devDependencies" : {
16
+ "dotenv" : " ^16.4.7" ,
17
+ "openai" : " ^4.81.0" ,
18
+ "sax" : " ^1.4.1"
14
19
}
15
20
}
Original file line number Diff line number Diff line change 35
35
"lz-string" : " ^1.5.0" ,
36
36
"prettier" : " ^3.5.2" ,
37
37
"xmldom" : " ^0.6.0" ,
38
- "xpath" : " 0.0.33" ,
39
- "dotenv" : " ^16.4.7" ,
40
- "openai" : " ^4.81.0" ,
41
- "sax" : " ^1.4.1"
38
+ "xpath" : " 0.0.33"
42
39
},
43
40
"resolutions" : {
44
41
"**/gl" : " ^8.0.2"
61
58
"try" : " cd docs_out; http-server --cors --port 8080" ,
62
59
"tryjson" : " http-server --cors --port 8080" ,
63
60
"nodetest" : " ./scripts/nodetest.sh" ,
64
- "trans" : " npx tsx ./i18n/ index.ts"
61
+ "trans" : " cd ./i18n && yarn install && npx tsx index.ts"
65
62
},
66
63
"husky" : {
67
64
"hooks" : {
Original file line number Diff line number Diff line change @@ -1276,6 +1276,13 @@ clean-stack@^2.0.0:
1276
1276
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b"
1277
1277
integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==
1278
1278
1279
+ cli-progress@^3.12.0 :
1280
+ version "3.12.0"
1281
+ resolved "https://registry.yarnpkg.com/cli-progress/-/cli-progress-3.12.0.tgz#807ee14b66bcc086258e444ad0f19e7d42577942"
1282
+ integrity sha512-tRkV3HJ1ASwm19THiiLIXLO7Im7wlTuKnvkYaTkyoAPefqjNg7W7DHKUlGRxy9vxDvbyCYQkQozvptuMkGCg8A==
1283
+ dependencies :
1284
+ string-width "^4.2.3"
1285
+
1279
1286
clone-deep@^4.0.1 :
1280
1287
version "4.0.1"
1281
1288
resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387"
@@ -2914,7 +2921,7 @@ ssri@^10.0.0:
2914
2921
is-fullwidth-code-point "^3.0.0"
2915
2922
strip-ansi "^6.0.1"
2916
2923
2917
- string-width@^4.1.0 :
2924
+ string-width@^4.1.0, string-width@^4.2.3 :
2918
2925
version "4.2.3"
2919
2926
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
2920
2927
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
You can’t perform that action at this time.
0 commit comments