[Templates] Use fallbacks when translating template titles and category names (#3494)

This commit is contained in:
Christian Byrne
2025-04-18 10:57:03 +08:00
committed by GitHub
parent 2f77d74891
commit e2a6dc2ec8
4 changed files with 59 additions and 14 deletions

View File

@@ -123,12 +123,13 @@ const overlayThumbnailSrc = computed(() =>
)
const title = computed(() => {
const fallback = template.title ?? template.name ?? `${sourceModule} Template`
return sourceModule === 'default'
? st(
`templateWorkflows.template.${normalizeI18nKey(categoryTitle)}.${normalizeI18nKey(template.name)}`,
template.name
fallback
)
: template.name ?? `${sourceModule} Template`
: fallback
})
const description = computed(() => template.description.replace(/[-_]/g, ' '))