[i18n] Translate widget label (#1883)

* [i18n] Translate widget label

* Update locales [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-12-11 18:03:56 -08:00
committed by GitHub
parent c5f77de1bf
commit f23530afcf
6 changed files with 29 additions and 14 deletions

View File

@@ -10,5 +10,5 @@ module.exports = defineConfig({
entryLocale: 'en',
output: 'src/locales',
outputLocales: ['zh', 'ru', 'ja', 'ko'],
reference: `Special names to keep untranslated: flux, photomaker, clip, vae`
reference: `Special names to keep untranslated: flux, photomaker, clip, vae, cfg`
});

View File

@@ -2395,6 +2395,20 @@
}
}
},
"Mahiro": {
"display_name": "Mahiro is so cute that she deserves a better guidance function!! (。・ω・。)",
"description": "Modify the guidance to scale more on the 'direction' of the positive prompt rather than the difference between the negative prompt.",
"inputs": {
"model": {
"name": "model"
}
},
"outputs": {
"0": {
"name": "patched_model"
}
}
},
"MaskComposite": {
"display_name": "MaskComposite",
"inputs": {

View File

@@ -1795,7 +1795,7 @@
"display_name": "Kサンプラー",
"inputs": {
"cfg": {
"name": "設定",
"name": "cfg",
"tooltip": "Classifier-Free Guidanceスケールは、創造性とプロンプトへの遵守のバランスを取ります。値が高いほど、生成される画像はプロンプトにより近くなりますが、値が高すぎると品質に悪影響を及ぼす可能性があります。"
},
"denoise": {
@@ -1848,7 +1848,7 @@
"name": "ノイズ追加"
},
"cfg": {
"name": "設定"
"name": "cfg"
},
"end_at_step": {
"name": "ステップ終了"

View File

@@ -1795,7 +1795,7 @@
"display_name": "KSampler",
"inputs": {
"cfg": {
"name": "конфиг",
"name": "cfg",
"tooltip": "Масштаб без классификатора балансирует креативность и соблюдение запроса. Более высокие значения приводят к изображениям, более точно соответствующим запросу, однако слишком высокие значения негативно скажутся на качестве."
},
"denoise": {
@@ -1848,7 +1848,7 @@
"name": обавить_шум"
},
"cfg": {
"name": "конфиг"
"name": "cfg"
},
"end_at_step": {
"name": акончить_нааге"

View File

@@ -79,7 +79,7 @@
"display_name": "CFG引导器",
"inputs": {
"cfg": {
"name": "配置"
"name": "cfg"
},
"model": {
"name": "模型"
@@ -1795,7 +1795,7 @@
"display_name": "K采样器",
"inputs": {
"cfg": {
"name": "配置",
"name": "cfg",
"tooltip": "无分类器引导比例平衡创造力和对提示的遵循。更高的值会导致图像更接近提示,但过高的值会对质量产生负面影响。"
},
"denoise": {
@@ -1848,7 +1848,7 @@
"name": "添加噪声"
},
"cfg": {
"name": "配置"
"name": "cfg"
},
"end_at_step": {
"name": "结束步骤"
@@ -3948,7 +3948,7 @@
"display_name": "PerpNeg引导器",
"inputs": {
"cfg": {
"name": "配置"
"name": "cfg"
},
"empty_conditioning": {
"name": "空条件"
@@ -4252,7 +4252,7 @@
"name": "添加噪声"
},
"cfg": {
"name": "配置"
"name": "cfg"
},
"latent_image": {
"name": "潜在图像"

View File

@@ -1914,6 +1914,7 @@ export class ComfyApp {
const type = _inputData[0]
const options = _inputData[1] ?? {}
const inputData = [type, options]
const nameKey = `nodeDefs.${normalizeI18nKey(nodeData.name)}.inputs.${normalizeI18nKey(inputName)}.name`
const inputIsRequired = requiredInputs && inputName in requiredInputs
@@ -1931,6 +1932,9 @@ export class ComfyApp {
self.widgets[widgetType](this, inputName, inputData, app) || {}
)
}
if (config.widget) {
config.widget.label = st(nameKey, inputName)
}
} else {
// Node connection inputs
const shapeOptions = inputIsRequired
@@ -1938,10 +1942,7 @@ export class ComfyApp {
: { shape: LiteGraph.SlotShape.HollowCircle }
const inputOptions = {
...shapeOptions,
label: st(
`nodeDefs.${normalizeI18nKey(nodeData.name)}.inputs.${normalizeI18nKey(inputName)}.name`,
inputName
)
label: st(nameKey, inputName)
}
this.addInput(inputName, type, inputOptions)
widgetCreated = false