Skip to content

Commit

Permalink
[i18n] Translate button widget labels (#2719)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <github-actions@github.com>
  • Loading branch information
huchenlei and github-actions authored Feb 25, 2025
1 parent d3dda14 commit f5cec41
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/composables/widgets/useImageUploadWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { IComboWidget } from '@comfyorg/litegraph/dist/types/widgets'
import { useNodeImage, useNodeVideo } from '@/composables/node/useNodeImage'
import { useNodeImageUpload } from '@/composables/node/useNodeImageUpload'
import { useValueTransform } from '@/composables/useValueTransform'
import { t } from '@/i18n'
import type { ComfyWidgetConstructor } from '@/scripts/widgets'
import { useNodeOutputStore } from '@/stores/imagePreviewStore'
import type { ComfyApp } from '@/types'
Expand Down Expand Up @@ -85,7 +86,7 @@ export const useImageUploadWidget = () => {
serialize: false
}
)
uploadWidget.label = 'choose file to upload'
uploadWidget.label = t('g.choose_file_to_upload')

// TODO: Explain this?
// @ts-expect-error LGraphNode.callback is not typed
Expand Down
3 changes: 2 additions & 1 deletion src/extensions/core/uploadAudio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { IStringWidget } from '@comfyorg/litegraph/dist/types/widgets'
import { useNodeDragAndDrop } from '@/composables/node/useNodeDragAndDrop'
import { useNodeFileInput } from '@/composables/node/useNodeFileInput'
import { useNodePaste } from '@/composables/node/useNodePaste'
import { t } from '@/i18n'
import type { DOMWidget } from '@/scripts/domWidget'
import { useToastStore } from '@/stores/toastStore'
import { ComfyNodeDef } from '@/types/apiTypes'
Expand Down Expand Up @@ -204,7 +205,7 @@ app.registerExtension({
openFileSelection,
{ serialize: false }
)
uploadWidget.label = 'choose file to upload'
uploadWidget.label = t('g.choose_file_to_upload')

useNodeDragAndDrop(node, {
fileFilter: isAudioFile,
Expand Down
3 changes: 2 additions & 1 deletion src/extensions/core/webcamCapture.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-strict-ignore
import { t } from '@/i18n'
import { useToastStore } from '@/stores/toastStore'

import { api } from '../../scripts/api'
Expand Down Expand Up @@ -140,7 +141,7 @@ app.registerExtension({
h.value = video.videoHeight || 480
}
btn.disabled = false
btn.label = 'capture'
btn.label = t('g.capture')
})
}
})
4 changes: 3 additions & 1 deletion src/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@
"feedback": "Feedback",
"continue": "Continue",
"control_after_generate": "control after generate",
"control_before_generate": "control before generate"
"control_before_generate": "control before generate",
"choose_file_to_upload": "choose file to upload",
"capture": "capture"
},
"issueReport": {
"submitErrorReport": "Submit Error Report (Optional)",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/fr/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"add": "Ajouter",
"back": "Retour",
"cancel": "Annuler",
"capture": "capture",
"choose_file_to_upload": "choisissez le fichier à télécharger",
"close": "Fermer",
"color": "Couleur",
"comingSoon": "Bientôt disponible",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/ja/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"add": "追加",
"back": "戻る",
"cancel": "キャンセル",
"capture": "キャプチャ",
"choose_file_to_upload": "アップロードするファイルを選択",
"close": "閉じる",
"color": "",
"comingSoon": "近日公開",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/ko/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"add": "추가",
"back": "뒤로",
"cancel": "취소",
"capture": "캡처",
"choose_file_to_upload": "업로드할 파일 선택",
"close": "닫기",
"color": "색상",
"comingSoon": "곧 출시 예정",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/ru/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"add": "Добавить",
"back": "Назад",
"cancel": "Отмена",
"capture": "захват",
"choose_file_to_upload": "выберите файл для загрузки",
"close": "Закрыть",
"color": "Цвет",
"comingSoon": "Скоро будет",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/zh/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"add": "添加",
"back": "返回",
"cancel": "取消",
"capture": "捕获",
"choose_file_to_upload": "选择要上传的文件",
"close": "关闭",
"color": "颜色",
"comingSoon": "即将推出",
Expand Down

0 comments on commit f5cec41

Please sign in to comment.