mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
Translate template categories (#2937)
Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -10,7 +10,7 @@ module.exports = defineConfig({
|
|||||||
entryLocale: 'en',
|
entryLocale: 'en',
|
||||||
output: 'src/locales',
|
output: 'src/locales',
|
||||||
outputLocales: ['zh', 'ru', 'ja', 'ko', 'fr'],
|
outputLocales: ['zh', 'ru', 'ja', 'ko', 'fr'],
|
||||||
reference: `Special names to keep untranslated: flux, photomaker, clip, vae, cfg, stable audio, stable cascade.
|
reference: `Special names to keep untranslated: flux, photomaker, clip, vae, cfg, stable audio, stable cascade, controlnet, lora.
|
||||||
'latent' is the short form of 'latent space'.
|
'latent' is the short form of 'latent space'.
|
||||||
'mask' is in the context of image processing.
|
'mask' is in the context of image processing.
|
||||||
`
|
`
|
||||||
|
|||||||
@@ -417,6 +417,20 @@
|
|||||||
},
|
},
|
||||||
"templateWorkflows": {
|
"templateWorkflows": {
|
||||||
"title": "Get Started with a Template",
|
"title": "Get Started with a Template",
|
||||||
|
"category": {
|
||||||
|
"ComfyUI Examples": "ComfyUI Examples",
|
||||||
|
"Custom Nodes": "Custom Nodes",
|
||||||
|
"Basics": "Basics",
|
||||||
|
"Flux": "Flux",
|
||||||
|
"ControlNet": "ControlNet",
|
||||||
|
"Upscaling": "Upscaling",
|
||||||
|
"Video": "Video",
|
||||||
|
"SD3_5": "SD3.5",
|
||||||
|
"SDXL": "SDXL",
|
||||||
|
"Area Composition": "Area Composition",
|
||||||
|
"3D": "3D",
|
||||||
|
"Audio": "Audio"
|
||||||
|
},
|
||||||
"template": {
|
"template": {
|
||||||
"Flux": {
|
"Flux": {
|
||||||
"flux_dev_checkpoint_example": "Flux Dev",
|
"flux_dev_checkpoint_example": "Flux Dev",
|
||||||
|
|||||||
@@ -826,6 +826,20 @@
|
|||||||
"removeFromBookmarks": "Retirer des Favoris"
|
"removeFromBookmarks": "Retirer des Favoris"
|
||||||
},
|
},
|
||||||
"templateWorkflows": {
|
"templateWorkflows": {
|
||||||
|
"category": {
|
||||||
|
"3D": "3D",
|
||||||
|
"Area Composition": "Composition de zone",
|
||||||
|
"Audio": "Audio",
|
||||||
|
"Basics": "Basiques",
|
||||||
|
"ComfyUI Examples": "Exemples ComfyUI",
|
||||||
|
"ControlNet": "ControlNet",
|
||||||
|
"Custom Nodes": "Nœuds personnalisés",
|
||||||
|
"Flux": "Flux",
|
||||||
|
"SD3_5": "SD3.5",
|
||||||
|
"SDXL": "SDXL",
|
||||||
|
"Upscaling": "Mise à l'échelle",
|
||||||
|
"Video": "Vidéo"
|
||||||
|
},
|
||||||
"template": {
|
"template": {
|
||||||
"3D": {
|
"3D": {
|
||||||
"stable_zero123_example": "Stable Zero123"
|
"stable_zero123_example": "Stable Zero123"
|
||||||
|
|||||||
@@ -826,6 +826,20 @@
|
|||||||
"removeFromBookmarks": "ブックマークから削除"
|
"removeFromBookmarks": "ブックマークから削除"
|
||||||
},
|
},
|
||||||
"templateWorkflows": {
|
"templateWorkflows": {
|
||||||
|
"category": {
|
||||||
|
"3D": "3D",
|
||||||
|
"Area Composition": "エリア構成",
|
||||||
|
"Audio": "オーディオ",
|
||||||
|
"Basics": "基本",
|
||||||
|
"ComfyUI Examples": "ComfyUIの例",
|
||||||
|
"ControlNet": "ControlNet",
|
||||||
|
"Custom Nodes": "カスタムノード",
|
||||||
|
"Flux": "Flux",
|
||||||
|
"SD3_5": "SD3.5",
|
||||||
|
"SDXL": "SDXL",
|
||||||
|
"Upscaling": "アップスケーリング",
|
||||||
|
"Video": "ビデオ"
|
||||||
|
},
|
||||||
"template": {
|
"template": {
|
||||||
"3D": {
|
"3D": {
|
||||||
"stable_zero123_example": "Stable Zero123"
|
"stable_zero123_example": "Stable Zero123"
|
||||||
|
|||||||
@@ -826,6 +826,20 @@
|
|||||||
"removeFromBookmarks": "북마크에서 제거"
|
"removeFromBookmarks": "북마크에서 제거"
|
||||||
},
|
},
|
||||||
"templateWorkflows": {
|
"templateWorkflows": {
|
||||||
|
"category": {
|
||||||
|
"3D": "3D",
|
||||||
|
"Area Composition": "영역 구성",
|
||||||
|
"Audio": "오디오",
|
||||||
|
"Basics": "기본",
|
||||||
|
"ComfyUI Examples": "ComfyUI 예시",
|
||||||
|
"ControlNet": "ControlNet",
|
||||||
|
"Custom Nodes": "사용자 정의 노드",
|
||||||
|
"Flux": "Flux",
|
||||||
|
"SD3_5": "SD3.5",
|
||||||
|
"SDXL": "SDXL",
|
||||||
|
"Upscaling": "업스케일링",
|
||||||
|
"Video": "비디오"
|
||||||
|
},
|
||||||
"template": {
|
"template": {
|
||||||
"3D": {
|
"3D": {
|
||||||
"stable_zero123_example": "스테이블 제로123"
|
"stable_zero123_example": "스테이블 제로123"
|
||||||
|
|||||||
@@ -826,6 +826,20 @@
|
|||||||
"removeFromBookmarks": "Удалить из закладок"
|
"removeFromBookmarks": "Удалить из закладок"
|
||||||
},
|
},
|
||||||
"templateWorkflows": {
|
"templateWorkflows": {
|
||||||
|
"category": {
|
||||||
|
"3D": "3D",
|
||||||
|
"Area Composition": "Композиция области",
|
||||||
|
"Audio": "Аудио",
|
||||||
|
"Basics": "Основы",
|
||||||
|
"ComfyUI Examples": "Примеры ComfyUI",
|
||||||
|
"ControlNet": "ControlNet",
|
||||||
|
"Custom Nodes": "Пользовательские узлы",
|
||||||
|
"Flux": "Flux",
|
||||||
|
"SD3_5": "SD3.5",
|
||||||
|
"SDXL": "SDXL",
|
||||||
|
"Upscaling": "Увеличение разрешения",
|
||||||
|
"Video": "Видео"
|
||||||
|
},
|
||||||
"template": {
|
"template": {
|
||||||
"3D": {
|
"3D": {
|
||||||
"stable_zero123_example": "Stable Zero123"
|
"stable_zero123_example": "Stable Zero123"
|
||||||
|
|||||||
@@ -826,6 +826,20 @@
|
|||||||
"removeFromBookmarks": "从书签中移除"
|
"removeFromBookmarks": "从书签中移除"
|
||||||
},
|
},
|
||||||
"templateWorkflows": {
|
"templateWorkflows": {
|
||||||
|
"category": {
|
||||||
|
"3D": "3D",
|
||||||
|
"Area Composition": "区域组成",
|
||||||
|
"Audio": "音频",
|
||||||
|
"Basics": "基础",
|
||||||
|
"ComfyUI Examples": "ComfyUI示例",
|
||||||
|
"ControlNet": "ControlNet",
|
||||||
|
"Custom Nodes": "自定义节点",
|
||||||
|
"Flux": "Flux",
|
||||||
|
"SD3_5": "SD3.5",
|
||||||
|
"SDXL": "SDXL",
|
||||||
|
"Upscaling": "放大",
|
||||||
|
"Video": "视频"
|
||||||
|
},
|
||||||
"template": {
|
"template": {
|
||||||
"3D": {
|
"3D": {
|
||||||
"stable_zero123_example": "稳定Zero123"
|
"stable_zero123_example": "稳定Zero123"
|
||||||
|
|||||||
@@ -1,23 +1,34 @@
|
|||||||
import { groupBy } from 'lodash'
|
import { groupBy } from 'lodash'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { computed, ref, shallowRef } from 'vue'
|
import { computed, ref, shallowRef } from 'vue'
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
import type {
|
import type {
|
||||||
TemplateGroup,
|
TemplateGroup,
|
||||||
WorkflowTemplates
|
WorkflowTemplates
|
||||||
} from '@/types/workflowTemplateTypes'
|
} from '@/types/workflowTemplateTypes'
|
||||||
|
import { normalizeI18nKey } from '@/utils/formatUtil'
|
||||||
|
|
||||||
export const useWorkflowTemplatesStore = defineStore(
|
export const useWorkflowTemplatesStore = defineStore(
|
||||||
'workflowTemplates',
|
'workflowTemplates',
|
||||||
() => {
|
() => {
|
||||||
|
const { t } = useI18n()
|
||||||
const customTemplates = shallowRef<{ [moduleName: string]: string[] }>({})
|
const customTemplates = shallowRef<{ [moduleName: string]: string[] }>({})
|
||||||
const coreTemplates = shallowRef<WorkflowTemplates[]>([])
|
const coreTemplates = shallowRef<WorkflowTemplates[]>([])
|
||||||
const isLoaded = ref(false)
|
const isLoaded = ref(false)
|
||||||
|
|
||||||
const groupedTemplates = computed<TemplateGroup[]>(() => {
|
const groupedTemplates = computed<TemplateGroup[]>(() => {
|
||||||
const allTemplates = [
|
const allTemplates = [
|
||||||
...coreTemplates.value,
|
...coreTemplates.value.map((template) => ({
|
||||||
|
...template,
|
||||||
|
title: t(
|
||||||
|
`templateWorkflows.category.${normalizeI18nKey(template.title)}`,
|
||||||
|
{
|
||||||
|
defaultValue: template.title
|
||||||
|
}
|
||||||
|
)
|
||||||
|
})),
|
||||||
...Object.entries(customTemplates.value).map(
|
...Object.entries(customTemplates.value).map(
|
||||||
([moduleName, templates]) => ({
|
([moduleName, templates]) => ({
|
||||||
moduleName,
|
moduleName,
|
||||||
@@ -33,8 +44,14 @@ export const useWorkflowTemplatesStore = defineStore(
|
|||||||
]
|
]
|
||||||
|
|
||||||
return Object.entries(
|
return Object.entries(
|
||||||
groupBy(allTemplates, (t) =>
|
groupBy(allTemplates, (template) =>
|
||||||
t.moduleName === 'default' ? 'ComfyUI Examples' : 'Custom Nodes'
|
template.moduleName === 'default'
|
||||||
|
? t('templateWorkflows.category.ComfyUI Examples', {
|
||||||
|
defaultValue: 'ComfyUI Examples'
|
||||||
|
})
|
||||||
|
: t('templateWorkflows.category.Custom Nodes', {
|
||||||
|
defaultValue: 'Custom Nodes'
|
||||||
|
})
|
||||||
)
|
)
|
||||||
).map(([label, modules]) => ({ label, modules }))
|
).map(([label, modules]) => ({ label, modules }))
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user