Add translation strings for quick actions component

This commit is contained in:
kolaente 2021-06-16 22:59:23 +02:00
parent 35ee77a5b6
commit f17ca517d8
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 41 additions and 20 deletions

View File

@ -123,22 +123,22 @@ export default {
return [
{
type: TYPE_CMD,
title: 'Commands',
title: this.$t('quickActions.commands'),
items: cmds,
},
{
type: TYPE_TASK,
title: 'Tasks',
title: this.$t('quickActions.tasks'),
items: this.foundTasks,
},
{
type: TYPE_LIST,
title: 'Lists',
title: this.$t('quickActions.lists'),
items: lists,
},
{
type: TYPE_TEAM,
title: 'Teams',
title: this.$t('quickActions.teams'),
items: this.foundTeams,
},
].filter(i => i.items.length > 0)
@ -156,17 +156,17 @@ export default {
if (this.selectedCmd !== null) {
switch (this.selectedCmd.action) {
case CMD_NEW_TASK:
return 'Enter the title of the new task...'
return this.$t('quickActions.newTask')
case CMD_NEW_LIST:
return 'Enter the title of the new list...'
return this.$t('quickActions.newList')
case CMD_NEW_NAMESPACE:
return 'Enter the title of the new namespace...'
return this.$t('quickActions.newNamespace')
case CMD_NEW_TEAM:
return 'Enter the name of the new team...'
return this.$t('quickActions.newTeam')
}
}
return 'Type a command or search...'
return this.$t('quickActions.placeholder')
},
hintText() {
let namespace
@ -174,14 +174,14 @@ export default {
if (this.selectedCmd !== null && this.currentList !== null) {
switch (this.selectedCmd.action) {
case CMD_NEW_TASK:
return `Create a task in the current list (${this.currentList.title})`
return this.$t('quickActions.createTask', {title: this.currentList.title})
case CMD_NEW_LIST:
namespace = this.$store.getters['namespaces/getNamespaceById'](this.currentList.namespaceId)
return `Create a list in the current namespace (${namespace.title})`
return this.$t('quickActions.createList', {title: namespace.title})
}
}
return 'You can use # to only seach for tasks, * to only search for lists and @ to only search for teams.'
return this.$t('quickActions.hint')
},
currentList() {
return Object.keys(this.$store.state[CURRENT_LIST]).length === 0 ? null : this.$store.state[CURRENT_LIST]
@ -191,20 +191,20 @@ export default {
if (this.currentList !== null) {
cmds.push({
title: 'New task',
title: this.$t('quickActions.cmds.newTask'),
action: CMD_NEW_TASK,
})
cmds.push({
title: 'New list',
title: this.$t('quickActions.cmds.newList'),
action: CMD_NEW_LIST,
})
}
cmds.push({
title: 'New namespace',
title: this.$t('quickActions.cmds.newNamespace'),
action: CMD_NEW_NAMESPACE,
})
cmds.push({
title: 'New Team',
title: this.$t('quickActions.cmds.newTeam'),
action: CMD_NEW_TEAM,
})
@ -361,7 +361,7 @@ export default {
})
this.taskService.create(newTask)
.then(r => {
this.success({message: 'The task was successfully created.'}, this)
this.success({message: this.$t('task.createSuccess')}, this)
this.$router.push({name: 'task.detail', params: {id: r.id}})
this.closeQuickActions()
})
@ -380,7 +380,7 @@ export default {
})
this.listService.create(newList)
.then(r => {
this.success({message: 'The list was successfully created.'}, this)
this.success({message: this.$t('list.create.createdSuccess')}, this)
this.$router.push({name: 'list.index', params: {listId: r.id}})
this.closeQuickActions()
})
@ -393,7 +393,7 @@ export default {
this.namespaceService.create(newNamespace)
.then(r => {
this.$store.commit('namespaces/addNamespace', r)
this.success({message: 'The namespace was successfully created.'}, this)
this.success({message: this.$t('namespace.create.success')}, this)
this.closeQuickActions()
})
.catch((e) => {
@ -408,7 +408,7 @@ export default {
name: 'teams.edit',
params: {id: r.id},
})
this.success({message: 'The team was successfully created.'}, this)
this.success({message: this.$t('team.create.success')}, this)
this.closeQuickActions()
})
.catch((e) => {

View File

@ -377,6 +377,7 @@
"task": "Task",
"new": "Create a new task",
"delete": "Delete this task",
"createSuccess": "The task was successfully created.",
"show": {
"titleCurrent": "Current Tasks",
"titleDates": "Tasks from {from} until {to}",
@ -538,5 +539,25 @@
"notification": {
"none": "You don't have any notifications. Have a nice day!",
"explainer": "Notifications will appear here when actions on namespaces, lists or tasks you subscribed to happen."
},
"quickActions": {
"commands": "Commands",
"placeholder": "Type a command or search...",
"hint": "You can use # to only seach for tasks, * to only search for lists and @ to only search for teams.",
"tasks": "Tasks",
"lists": "Lists",
"teams": "Teams",
"newList": "Enter the title of the new list...",
"newTask": "Enter the title of the new task...",
"newNamespace": "Enter the title of the new namespace...",
"newTeam": "Enter the name of the new team...",
"createTask": "Create a task in the current list ({title})",
"createList": "Create a list in the current namespace ({title})",
"cmds": {
"newTask": "New task",
"newList": "New list",
"newNamespace": "New namespace",
"newTeam": "New team"
}
}
}