Skip to content

Commit

Permalink
[i18n] Translate button widget labels
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Feb 25, 2025
1 parent d3dda14 commit 465acd3
Show file tree
Hide file tree
Showing 4 changed files with 9 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

0 comments on commit 465acd3

Please sign in to comment.