Skip to content

Commit 62e4731

Browse files
committed
更新版本V0.0.72
1 parent 4a8b8da commit 62e4731

File tree

8 files changed

+231
-199
lines changed

8 files changed

+231
-199
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,28 @@
3030

3131
# 版本更新介绍
3232

33-
> 最新更新:2025-12-20
33+
> 最新更新:2025-12-21
3434
35-
> 0.0.71 公测版本介绍 如果你要使用本插件请务必进我们的官方 QQ 群(1018231382)!
35+
> 0.0.72 公测版本介绍 如果你要使用本插件请务必进我们的官方 QQ 群(1018231382)!
3636
>
3737
> 1. API翻译模式回归,现在翻译接口重写目前只支持 阿里巴巴翻译接口、Bing翻译接口、有道翻译接口(该接口有请求限制不建议使用),目前这三个接口都是免费,后续会写付费的翻译接口对接
3838
>
3939
> 2. 修改了硅基AI和OpenAI翻译的问题,回归成原有的模式
4040
>
41+
> 3. 合并PR [#57](https://github.com/weilin9999/WeiLin-Comfyui-Tools/pull/57) 感谢各位小伙伴的帮助
42+
>
4143
4244
<details>
4345
<summary>点击查看往期更多更新内容</summary>
4446

47+
48+
> 0.0.71 公测版本介绍 2025-12-20
49+
>
50+
> 1. API翻译模式回归,现在翻译接口重写目前只支持 阿里巴巴翻译接口、Bing翻译接口、有道翻译接口(该接口有请求限制不建议使用),目前这三个接口都是免费,后续会写付费的翻译接口对接
51+
>
52+
> 2. 修改了硅基AI和OpenAI翻译的问题,回归成原有的模式
53+
>
54+
4555
> 0.0.70 公测版本介绍 2025-12-19
4656
>
4757
> 1. API翻译模式回归,现在翻译接口重写目前只支持 阿里巴巴翻译接口、Bing翻译接口、有道翻译接口(该接口有请求限制不建议使用),目前这三个接口都是免费,后续会写付费的翻译接口对接

README_EN.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,28 @@ Due to limited personal time, the frequency of updating plug-ins will not be ver
2424

2525
# Version update introduction
2626

27-
> Last updated: 2025-12-20
27+
> Last updated: 2025-12-21
2828
29-
> 0.0.71 Public Beta Version Introduction: If you want to use this plugin, please be sure to join our official QQ group (1018231382)!
29+
> 0.0.72 Public Beta Version Introduction: If you want to use this plugin, please be sure to join our official QQ group (1018231382)!
3030
>
3131
> 1. The API translation mode has returned. Currently, the translation interface has been rewritten and only supports Alibaba Translation Interface, Bing Translation interface, and Youdao Translation interface (this interface has request restrictions and is not recommended for use). At present, all three interfaces are free, and we will write paid translation interfaces for integration in the future
3232
>
3333
> 2. The issues with silicon-based AI and OpenAI translation have been modified, and the original model has been restored
3434
>
35+
> 3. Merger PR [#57](https://github.com/weilin9999/WeiLin-Comfyui-Tools/pull/57) thank you for your friend's help
36+
>
3537
3638
<details>
3739
<summary>Click here for more updates from the past</summary>
3840

41+
> 0.0.71 Public Beta Version 2025-12-20
42+
>
43+
> 1. The API translation mode has returned. Currently, the translation interface has been rewritten and only supports Alibaba Translation Interface, Bing Translation interface, and Youdao Translation interface (this interface has request restrictions and is not recommended for use). At present, all three interfaces are free, and we will write paid translation interfaces for integration in the future
44+
>
45+
> 2. The issues with silicon-based AI and OpenAI translation have been modified, and the original model has been restored
46+
>
47+
48+
3949
> 0.0.70 Public Beta Version 2025-12-19
4050
>
4151
> 1. The API translation mode has returned. Currently, the translation interface has been rewritten and only supports Alibaba Translation Interface, Bing Translation interface, and Youdao Translation interface (this interface has request restrictions and is not recommended for use). At present, all three interfaces are free, and we will write paid translation interfaces for integration in the future

dist/javascript/main.entry.js

Lines changed: 96 additions & 101 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/javascript/main.entry.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "weilin-comfyui-tools"
33
description = "让你在 ComfyUI 中快捷的使用提示词工具 Quickly use the prompt word tool in ComfyUI"
4-
version = "0.0.71"
4+
version = "0.0.72"
55
license = {file = "LICENSE"}
66
dependencies = []
77

src/src/utils/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const version = "v0.0.71";
1+
export const version = "v0.0.72";

src/src/view/prompt_box/prompt_index.vue

Lines changed: 107 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,24 +1942,24 @@ const oneClickTranslatePrompt = async () => {
19421942
19431943
if (batchData.length > 0) {
19441944
console.log(`处理第 ${Math.floor(currentIndex / batchSize) + 1} 批,翻译 ${batchData.length} 个项目`);
1945-
1945+
19461946
// 批量翻译:将多个文本用换行符连接
19471947
const combinedText = batchData.join('\n');
19481948
try {
19491949
// 设置超时处理
1950-
const timeoutPromise = new Promise((_, reject) =>
1950+
const timeoutPromise = new Promise((_, reject) =>
19511951
setTimeout(() => reject(new Error('翻译请求超时')), 30000)
19521952
);
1953-
1953+
19541954
const res = await Promise.race([
19551955
translatorApi.translaterText('', combinedText),
19561956
timeoutPromise
19571957
]);
1958-
1958+
19591959
if (res.data && res.data.length > 0) {
19601960
// 拆分翻译结果
19611961
const translatedResults = res.data.split('\n');
1962-
1962+
19631963
// 验证结果数量匹配
19641964
if (translatedResults.length === batchData.length) {
19651965
// 将翻译结果回填到对应的token
@@ -1980,13 +1980,13 @@ const oneClickTranslatePrompt = async () => {
19801980
} catch (e) {
19811981
console.error(`${Math.floor(currentIndex / batchSize) + 1} 批批量翻译失败:`, e);
19821982
console.log('回退到逐个翻译模式...');
1983-
1983+
19841984
// 回退到逐个翻译
19851985
let fallbackCount = 0;
19861986
for (let j = 0; j < tokenIndices.length; j++) {
19871987
const tokenIndex = tokenIndices[j];
19881988
const textToTranslate = batchData[j];
1989-
1989+
19901990
try {
19911991
const res = await translatorApi.translaterText('', textToTranslate);
19921992
if (res.data && res.data.length > 0) {
@@ -2004,7 +2004,7 @@ const oneClickTranslatePrompt = async () => {
20042004
20052005
currentIndex = endIndex;
20062006
}
2007-
2007+
20082008
console.log(`批量翻译完成!总共处理 ${processedCount}/${totalCount} 个项目`);
20092009
// }
20102010
@@ -3310,91 +3310,108 @@ const translateFunction = (texts, token) => {
33103310
33113311
const finishTranslateEnter = () => {
33123312
3313-
if (localStorage.getItem('weilin_prompt_ui_translater_setting') == 'network') {
3314-
// const restran = translate.language.recognition(translateText.value)
3315-
// var obj = {
3316-
// from: restran.languageName,
3317-
// to: 'english',
3318-
// texts: [translateText.value]
3319-
// }
3320-
3321-
// translate.request.translateText(obj, function (data) {
3322-
// if (data.result > 0) {
3323-
// const translatedText = data.text.map(item => item.replace(/[\[\]“”]/g, '')).join(', ');
3324-
// tokens.value.push({
3325-
// text: translatedText,
3326-
// translate: translateText.value,
3327-
// isPunctuation: false,
3328-
// isEditing: false,
3329-
// isHidden: false,
3330-
// color: ''
3331-
// });
3332-
// translateText.value = ''
3333-
// updateInputText()
3334-
// }
3335-
// //打印翻译结果
3336-
// // console.log(data);
3337-
// });
3338-
} else if (localStorage.getItem('weilin_prompt_ui_translater_setting') == 'translater') {
3339-
// API翻译
3340-
translatorApi.translaterInputText('', translateText.value).then(res => {
3341-
// console.log(res)
3342-
if (res.text.length > 0) {
3343-
tokens.value.push({
3344-
text: res.data,
3345-
translate: translateText.value,
3346-
isPunctuation: false,
3347-
isEditing: false,
3348-
isHidden: false,
3349-
color: ''
3350-
});
3351-
translateText.value = ''
3352-
updateInputText()
3353-
}
3354-
})
3313+
// API翻译
3314+
translatorApi.translaterInputText('', translateText.value).then(res => {
3315+
// console.log(res)
3316+
if (res.data.length > 0) {
3317+
tokens.value.push({
3318+
text: res.data,
3319+
translate: translateText.value,
3320+
isPunctuation: false,
3321+
isEditing: false,
3322+
isHidden: false,
3323+
color: ''
3324+
});
3325+
translateText.value = ''
3326+
updateInputText()
3327+
}
3328+
})
33553329
3356-
} else {
3330+
// if (localStorage.getItem('weilin_prompt_ui_translater_setting') == 'network') {
3331+
// // const restran = translate.language.recognition(translateText.value)
3332+
// // var obj = {
3333+
// // from: restran.languageName,
3334+
// // to: 'english',
3335+
// // texts: [translateText.value]
3336+
// // }
3337+
3338+
// // translate.request.translateText(obj, function (data) {
3339+
// // if (data.result > 0) {
3340+
// // const translatedText = data.text.map(item => item.replace(/[\[\]“”]/g, '')).join(', ');
3341+
// // tokens.value.push({
3342+
// // text: translatedText,
3343+
// // translate: translateText.value,
3344+
// // isPunctuation: false,
3345+
// // isEditing: false,
3346+
// // isHidden: false,
3347+
// // color: ''
3348+
// // });
3349+
// // translateText.value = ''
3350+
// // updateInputText()
3351+
// // }
3352+
// // //打印翻译结果
3353+
// // // console.log(data);
3354+
// // });
3355+
// } else if (localStorage.getItem('weilin_prompt_ui_translater_setting') == 'translater') {
3356+
// // API翻译
3357+
// translatorApi.translaterInputText('', translateText.value).then(res => {
3358+
// // console.log(res)
3359+
// if (res.text.length > 0) {
3360+
// tokens.value.push({
3361+
// text: res.data,
3362+
// translate: translateText.value,
3363+
// isPunctuation: false,
3364+
// isEditing: false,
3365+
// isHidden: false,
3366+
// color: ''
3367+
// });
3368+
// translateText.value = ''
3369+
// updateInputText()
3370+
// }
3371+
// })
33573372
3358-
let needTranslateData = { text: translateText.value, translate: '' }
3359-
const jsonString = JSON.stringify(needTranslateData)
3360-
3361-
translatorApi.translaterInputText(jsonString, "").then(res => {
3362-
if (res) {
3363-
if (res.data) {
3364-
const jsonData = JSON.parse(res.data)
3365-
// console.log(jsonData)
3366-
// token.translate = jsonData.translate
3367-
3368-
tokens.value.push({
3369-
text: jsonData.translate,
3370-
translate: translateText.value,
3371-
isPunctuation: false,
3372-
isEditing: false,
3373-
isHidden: false,
3374-
color: ''
3375-
});
3376-
translateText.value = ''
3377-
updateInputText()
3378-
}
3379-
}
3380-
})
3373+
// } else {
33813374
3382-
// translatorApi.translaterInputText(translateText.value).then(res => {
3383-
// // console.log(res)
3384-
// if (res.text.length > 0) {
3385-
// tokens.value.push({
3386-
// text: res.text,
3387-
// translate: translateText.value,
3388-
// isPunctuation: false,
3389-
// isEditing: false,
3390-
// isHidden: false,
3391-
// color: ''
3392-
// });
3393-
// translateText.value = ''
3394-
// updateInputText()
3395-
// }
3396-
// })
3397-
}
3375+
// let needTranslateData = { text: translateText.value, translate: '' }
3376+
// const jsonString = JSON.stringify(needTranslateData)
3377+
3378+
// translatorApi.translaterInputText(jsonString, "").then(res => {
3379+
// if (res) {
3380+
// if (res.data) {
3381+
// const jsonData = JSON.parse(res.data)
3382+
// // console.log(jsonData)
3383+
// // token.translate = jsonData.translate
3384+
3385+
// tokens.value.push({
3386+
// text: jsonData.translate,
3387+
// translate: translateText.value,
3388+
// isPunctuation: false,
3389+
// isEditing: false,
3390+
// isHidden: false,
3391+
// color: ''
3392+
// });
3393+
// translateText.value = ''
3394+
// updateInputText()
3395+
// }
3396+
// }
3397+
// })
3398+
3399+
// // translatorApi.translaterInputText(translateText.value).then(res => {
3400+
// // // console.log(res)
3401+
// // if (res.text.length > 0) {
3402+
// // tokens.value.push({
3403+
// // text: res.text,
3404+
// // translate: translateText.value,
3405+
// // isPunctuation: false,
3406+
// // isEditing: false,
3407+
// // isHidden: false,
3408+
// // color: ''
3409+
// // });
3410+
// // translateText.value = ''
3411+
// // updateInputText()
3412+
// // }
3413+
// // })
3414+
// }
33983415
33993416
}
34003417

0 commit comments

Comments
 (0)