From 59b62eadf1a0f5d90d359e5175337af1c73b5e80 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Fri, 13 Dec 2024 16:56:37 -0800 Subject: [PATCH] [i18n] Translate save/export workflow dialog (#1906) * [i18n] Translate save/export workflow dialog * Update locales [skip ci] --------- Co-authored-by: github-actions --- src/locales/en/main.json | 5 +++++ src/locales/ja/main.json | 5 +++++ src/locales/ko/main.json | 5 +++++ src/locales/ru/main.json | 5 +++++ src/locales/zh/main.json | 5 +++++ src/services/dialogService.ts | 4 ++-- src/services/workflowService.ts | 8 ++++---- 7 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/locales/en/main.json b/src/locales/en/main.json index b251dd794..16cc4a9dc 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -615,6 +615,11 @@ "saveAsTemplate": "Save as template", "enterName": "Enter name" }, + "workflowService": { + "exportWorkflow": "Export Workflow", + "enterFilename": "Enter the filename", + "saveWorkflow": "Save workflow" + }, "electronFileDownload": { "inProgress": "In Progress", "pause": "Pause Download", diff --git a/src/locales/ja/main.json b/src/locales/ja/main.json index 2b47450f7..daf606257 100644 --- a/src/locales/ja/main.json +++ b/src/locales/ja/main.json @@ -949,5 +949,10 @@ "welcome": { "getStarted": "はじめる", "title": "ComfyUIへようこそ" + }, + "workflowService": { + "enterFilename": "ファイル名を入力", + "exportWorkflow": "ワークフローをエクスポート", + "saveWorkflow": "ワークフローを保存" } } \ No newline at end of file diff --git a/src/locales/ko/main.json b/src/locales/ko/main.json index 5daff0b40..937e78384 100644 --- a/src/locales/ko/main.json +++ b/src/locales/ko/main.json @@ -949,5 +949,10 @@ "welcome": { "getStarted": "시작하기", "title": "ComfyUI에 오신 것을 환영합니다" + }, + "workflowService": { + "enterFilename": "파일 이름 입력", + "exportWorkflow": "워크플로우 내보내기", + "saveWorkflow": "워크플로우 저장" } } \ No newline at end of file diff --git a/src/locales/ru/main.json b/src/locales/ru/main.json index bca5fe5e3..9bb0fb357 100644 --- a/src/locales/ru/main.json +++ b/src/locales/ru/main.json @@ -949,5 +949,10 @@ "welcome": { "getStarted": "Начать", "title": "Добро пожаловать в ComfyUI" + }, + "workflowService": { + "enterFilename": "Введите имя файла", + "exportWorkflow": "Экспорт рабочего процесса", + "saveWorkflow": "Сохранить рабочий процесс" } } \ No newline at end of file diff --git a/src/locales/zh/main.json b/src/locales/zh/main.json index 391460e3d..4b4912358 100644 --- a/src/locales/zh/main.json +++ b/src/locales/zh/main.json @@ -949,5 +949,10 @@ "welcome": { "getStarted": "开始使用", "title": "欢迎使用 ComfyUI" + }, + "workflowService": { + "enterFilename": "输入文件名", + "exportWorkflow": "导出工作流", + "saveWorkflow": "保存工作流" } } \ No newline at end of file diff --git a/src/services/dialogService.ts b/src/services/dialogService.ts index 72ff29079..ed7abf4d6 100644 --- a/src/services/dialogService.ts +++ b/src/services/dialogService.ts @@ -11,7 +11,7 @@ import ExecutionErrorDialogContent from '@/components/dialog/content/ExecutionEr import TemplateWorkflowsContent from '@/components/templates/TemplateWorkflowsContent.vue' import PromptDialogContent from '@/components/dialog/content/PromptDialogContent.vue' import ConfirmationDialogContent from '@/components/dialog/content/ConfirmationDialogContent.vue' -import { i18n } from '@/i18n' +import { t } from '@/i18n' import type { MissingNodeType } from '@/types/comfy' export function showLoadWorkflowWarning(props: { @@ -60,7 +60,7 @@ export function showExecutionErrorDialog(error: ExecutionErrorWsMessage) { export function showTemplateWorkflowsDialog() { useDialogStore().showDialog({ key: 'global-template-workflows', - title: i18n.global.t('templateWorkflows.title'), + title: t('templateWorkflows.title'), component: TemplateWorkflowsContent }) } diff --git a/src/services/workflowService.ts b/src/services/workflowService.ts index fe963e122..2faf48d82 100644 --- a/src/services/workflowService.ts +++ b/src/services/workflowService.ts @@ -15,8 +15,8 @@ import { useToastStore } from '@/stores/toastStore' async function getFilename(defaultName: string): Promise { if (useSettingStore().get('Comfy.PromptFilename')) { let filename = await showPromptDialog({ - title: 'Export Workflow', - message: 'Enter the filename:', + title: t('workflowService.exportWorkflow'), + message: t('workflowService.enterFilename') + ':', defaultValue: defaultName }) if (!filename) return null @@ -56,8 +56,8 @@ export const workflowService = { */ async saveWorkflowAs(workflow: ComfyWorkflow) { const newFilename = await showPromptDialog({ - title: 'Save workflow', - message: 'Enter the filename:', + title: t('workflowService.saveWorkflow'), + message: t('workflowService.enterFilename') + ':', defaultValue: workflow.filename }) if (!newFilename) return