fix(i18n): add translation for favorite project description
All checks were successful
continuous-integration/drone/push Build is passing

Resolves https://community.vikunja.io/t/missing-strings-in-language-files/3532
This commit is contained in:
kolaente 2025-03-21 12:58:04 +01:00
parent ae04f9b4f4
commit 6c08ce814b
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 8 additions and 0 deletions

View File

@ -226,6 +226,7 @@
"unfavorite": "Remove this project from favorites",
"openSettingsMenu": "Open project settings menu",
"description": "Project description",
"favoriteDescription": "This project has all tasks marked as favorites.",
"create": {
"header": "New project",
"titlePlaceholder": "The project's title goes here…",

View File

@ -27,11 +27,14 @@
import {computed} from 'vue'
import DOMPurify from 'dompurify'
import {useProjectStore} from '@/stores/projects'
import {useI18n} from 'vue-i18n'
const props = defineProps<{
projectId: number
}>()
const {t} = useI18n()
const projectStore = useProjectStore()
const project = computed(() => projectStore.projects[props.projectId])
const htmlDescription = computed(() => {
@ -39,6 +42,10 @@ const htmlDescription = computed(() => {
if (description === '') {
return ''
}
if (project.value.id === -1) {
return t('project.favoriteDescription')
}
return DOMPurify.sanitize(description, {ADD_ATTR: ['target']})
})