Skip to content

Commit c57ceaf

Browse files
fix: add missing translations (#6970)
## Summary Adds translations for things identified as "always English" during QA testing. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6970-fix-add-missing-translations-2b86d73d365081ffa58ccef156d28028) by [Unito](https://www.unito.io)
1 parent 29dbfa3 commit c57ceaf

File tree

3 files changed

+41
-21
lines changed

3 files changed

+41
-21
lines changed

src/locales/en/main.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@
131131
"newFolder": "New Folder",
132132
"enableAll": "Enable All",
133133
"disableAll": "Disable All",
134+
"enableSelected": "Enable Selected",
135+
"disableSelected": "Disable Selected",
136+
"disableThirdParty": "Disable Third-Party",
137+
"core": "Core",
138+
"custom": "Custom",
134139
"command": "Command",
135140
"keybinding": "Keybinding",
136141
"upload": "Upload",

src/platform/settings/components/ExtensionPanel.vue

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@
3030
</Message>
3131
</template>
3232
<div class="mb-3 flex gap-2">
33-
<SelectButton v-model="filterType" :options="filterTypes" />
33+
<SelectButton
34+
v-model="filterType"
35+
:options="filterTypes"
36+
option-label="label"
37+
option-value="value"
38+
/>
3439
</div>
3540
<DataTable
3641
v-model:selection="selectedExtensions"
@@ -47,9 +52,9 @@
4752
{{ slotProps.data.name }}
4853
<Tag
4954
v-if="extensionStore.isCoreExtension(slotProps.data.name)"
50-
value="Core"
55+
:value="$t('g.core')"
5156
/>
52-
<Tag v-else value="Custom" severity="info" />
57+
<Tag v-else :value="$t('g.custom')" severity="info" />
5358
</template>
5459
</Column>
5560
<Column
@@ -90,15 +95,26 @@ import SelectButton from 'primevue/selectbutton'
9095
import Tag from 'primevue/tag'
9196
import ToggleSwitch from 'primevue/toggleswitch'
9297
import { computed, onMounted, ref } from 'vue'
98+
import { useI18n } from 'vue-i18n'
9399
94100
import SearchBox from '@/components/common/SearchBox.vue'
95101
import PanelTemplate from '@/components/dialog/content/setting/PanelTemplate.vue'
96102
import { useSettingStore } from '@/platform/settings/settingStore'
97103
import { useExtensionStore } from '@/stores/extensionStore'
104+
import type { ComfyExtension } from '@/types/comfy'
105+
106+
const { t } = useI18n()
98107
99-
const filterTypes = ['All', 'Core', 'Custom']
100-
const filterType = ref('All')
101-
const selectedExtensions = ref<Array<any>>([])
108+
const filterTypeKeys = ['all', 'core', 'custom'] as const
109+
type FilterTypeKey = (typeof filterTypeKeys)[number]
110+
const filterTypes = computed(() =>
111+
filterTypeKeys.map((key) => ({
112+
label: t(`g.${key}`),
113+
value: key
114+
}))
115+
)
116+
const filterType = ref<FilterTypeKey>('all')
117+
const selectedExtensions = ref<ComfyExtension[]>([])
102118
103119
const filters = ref({
104120
global: { value: '', matchMode: FilterMatchMode.CONTAINS }
@@ -112,11 +128,11 @@ const editingEnabledExtensions = ref<Record<string, boolean>>({})
112128
const filteredExtensions = computed(() => {
113129
const extensions = extensionStore.extensions
114130
switch (filterType.value) {
115-
case 'Core':
131+
case 'core':
116132
return extensions.filter((ext) =>
117133
extensionStore.isCoreExtension(ext.name)
118134
)
119-
case 'Custom':
135+
case 'custom':
120136
return extensions.filter(
121137
(ext) => !extensionStore.isCoreExtension(ext.name)
122138
)
@@ -190,9 +206,9 @@ const applyChanges = () => {
190206
}
191207
192208
const menu = ref<InstanceType<typeof ContextMenu>>()
193-
const contextMenuItems = [
209+
const contextMenuItems = computed(() => [
194210
{
195-
label: 'Enable Selected',
211+
label: t('g.enableSelected'),
196212
icon: 'pi pi-check',
197213
command: async () => {
198214
selectedExtensions.value.forEach((ext) => {
@@ -204,7 +220,7 @@ const contextMenuItems = [
204220
}
205221
},
206222
{
207-
label: 'Disable Selected',
223+
label: t('g.disableSelected'),
208224
icon: 'pi pi-times',
209225
command: async () => {
210226
selectedExtensions.value.forEach((ext) => {
@@ -219,20 +235,20 @@ const contextMenuItems = [
219235
separator: true
220236
},
221237
{
222-
label: 'Enable All',
238+
label: t('g.enableAll'),
223239
icon: 'pi pi-check',
224240
command: enableAllExtensions
225241
},
226242
{
227-
label: 'Disable All',
243+
label: t('g.disableAll'),
228244
icon: 'pi pi-times',
229245
command: disableAllExtensions
230246
},
231247
{
232-
label: 'Disable 3rd Party',
248+
label: t('g.disableThirdParty'),
233249
icon: 'pi pi-times',
234250
command: disableThirdPartyExtensions,
235251
disabled: !extensionStore.hasThirdPartyExtensions
236252
}
237-
]
253+
])
238254
</script>

src/platform/workflow/templates/repositories/workflowTemplatesStore.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,19 +334,18 @@ export const useWorkflowTemplatesStore = defineStore(
334334
})
335335

336336
// 2. Basics (isEssential categories) - always second if it exists
337-
let gettingStartedText = 'Getting Started'
338337
const essentialCat = coreTemplates.value.find(
339338
(cat) => cat.isEssential && cat.templates.length > 0
340339
)
341-
const hasEssentialCategories = Boolean(essentialCat)
342340

343341
if (essentialCat) {
344-
gettingStartedText = essentialCat.title
345-
}
346-
if (hasEssentialCategories) {
342+
const categoryTitle = essentialCat.title ?? 'Getting Started'
347343
items.push({
348344
id: 'basics',
349-
label: gettingStartedText,
345+
label: st(
346+
`templateWorkflows.category.${normalizeI18nKey(categoryTitle)}`,
347+
categoryTitle
348+
),
350349
icon: 'icon-[lucide--graduation-cap]'
351350
})
352351
}

0 commit comments

Comments
 (0)