Pluralize related task kinds if there is more than one

This commit is contained in:
kolaente 2020-04-14 22:23:42 +02:00
parent cd6dee88b9
commit e2137d08a5
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 51 additions and 12 deletions

View File

@ -46,7 +46,7 @@
<div class="related-tasks" v-for="(rts, kind ) in relatedTasks" :key="kind">
<template v-if="rts.length > 0">
<span class="title">{{ relationKinds[kind] }}</span>
<span class="title">{{ relationKindTitle(kind, rts.length) }}</span>
<div class="tasks noborder">
<div class="task" v-for="t in rts" :key="t.id">
<router-link :to="{ name: 'taskDetailView', params: { id: t.id } }">
@ -209,6 +209,12 @@
this.error(e, this)
})
},
relationKindTitle(kind, length) {
if (length > 1) {
return relationKinds[kind][1]
}
return relationKinds[kind][0]
}
},
}
</script>

View File

@ -1,13 +1,46 @@
{
"subtask": "Subtask",
"parenttask": "Parent Task",
"related": "Related Task",
"duplicateof": "Duplicate Of",
"duplicates": "Duplicates",
"blocking": "Blocking",
"blocked": "Blocked By",
"precedes": "Preceds",
"follows": "Follows",
"copiedfrom": "Copied From",
"copiedto": "Copied To"
"subtask": [
"Subtask",
"Subtasks"
],
"parenttask": [
"Parent Task",
"Parent Tasks"
],
"related": [
"Related Task",
"Related Tasks"
],
"duplicateof": [
"Duplicate Of",
"Duplicates Of"
],
"duplicates": [
"Duplicates",
"Duplicates"
],
"blocking": [
"Blocking",
"Blocking"
],
"blocked": [
"Blocked By",
"Blocked By"
],
"precedes": [
"Preceds",
"Preceds"
],
"follows": [
"Follows",
"Follows"
],
"copiedfrom": [
"Copied From",
"Copied From"
],
"copiedto": [
"Copied To",
"Copied To"
]
}