fix: make task relation kinds translatable

Related to #774
This commit is contained in:
kolaente 2021-10-04 21:52:18 +02:00
parent e941394147
commit 2a1004ac68
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
4 changed files with 31 additions and 56 deletions

View file

@ -56,9 +56,9 @@
<div class="control is-expanded">
<div class="select is-fullwidth has-defaults">
<select v-model="newTaskRelationKind">
<option value="unset">Select a relation kind</option>
<option :key="rk" :value="rk" v-for="(label, rk) in relationKinds">
{{ label[0] }}
<option value="unset">{{ $t('task.relation.select') }}</option>
<option :key="rk" :value="rk" v-for="rk in relationKinds">
{{ $tc(`task.relation.kinds.${rk}`, 1) }}
</option>
</select>
</div>
@ -256,10 +256,7 @@ export default {
})
},
relationKindTitle(kind, length) {
if (length > 1) {
return relationKinds[kind][1]
}
return relationKinds[kind][0]
return this.$tc(`task.relation.kinds.${kind}`, length)
},
},
}

View file

@ -645,7 +645,21 @@
"noneYet": "No task relations yet.",
"delete": "Delete Task Relation",
"deleteText1": "Are you sure you want to delete this task relation?",
"deleteText2": "This cannot be undone!"
"deleteText2": "This cannot be undone!",
"select": "Select a relation kind",
"kinds": {
"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": "Precedes | Precedes",
"follows": "Follows | Follows",
"copiedfrom": "Copied From | Copied From",
"copiedto": "Copied To | Copied To"
}
},
"repeat": {
"everyDay": "Every Day",

View file

@ -1,46 +1,12 @@
{
"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": [
"Precedes",
"Precedes"
],
"follows": [
"Follows",
"Follows"
],
"copiedfrom": [
"Copied From",
"Copied From"
],
"copiedto": [
"Copied To",
"Copied To"
]
}
[
"subtask",
"parenttask",
"related",
"duplicates",
"blocking",
"blocked",
"precedes",
"follows",
"copiedfrom",
"copiedto"
]

View file

@ -423,7 +423,6 @@
<script>
import TaskService from '../../services/task'
import TaskModel from '../../models/task'
import relationKinds from '../../models/constants/relationKinds.json'
import priorites from '../../models/constants/priorities.json'
import rights from '../../models/constants/rights.json'
@ -473,7 +472,6 @@ export default {
return {
taskService: new TaskService(),
task: new TaskModel(),
relationKinds: relationKinds,
// We doubled the task color property here because verte does not have a real change property, leading
// to the color property change being triggered when the # is removed from it, leading to an update,
// which leads in turn to a change... This creates an infinite loop in which the task is updated, changed,