Improve some translations (#581)

Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/581
Reviewed-by: konrad <konrad@kola-entertainments.de>
Co-authored-by: andreymal <andriyano-31@mail.ru>
Co-committed-by: andreymal <andriyano-31@mail.ru>
This commit is contained in:
andreymal 2021-07-09 08:22:20 +00:00 committed by konrad
parent 096fc0bbc8
commit 7355204d2f
14 changed files with 61 additions and 19 deletions

View file

@ -54,14 +54,14 @@
<span
@click="toggleLists(n.id)"
class="menu-label"
v-tooltip="n.title + ' (' + n.lists.filter(l => !l.isArchived).length + ')'">
v-tooltip="getNamespaceTitle(n) + ' (' + n.lists.filter(l => !l.isArchived).length + ')'">
<span class="name">
<span
:style="{ backgroundColor: n.hexColor }"
class="color-bubble"
v-if="n.hexColor !== ''">
</span>
{{ n.title }} ({{ n.lists.filter(l => !l.isArchived).length }})
{{ getNamespaceTitle(n) }} ({{ n.lists.filter(l => !l.isArchived).length }})
</span>
</span>
<a
@ -91,7 +91,7 @@
v-if="l.hexColor !== ''">
</span>
<span class="list-menu-title">
{{ l.title }}
{{ getListTitle(l) }}
</span>
<span
:class="{'is-favorite': l.isFavorite}"

View file

@ -30,7 +30,7 @@
<h1
:style="{ 'opacity': currentList.title === '' ? '0': '1' }"
class="title">
{{ currentList.title === '' ? $t('misc.loading') : currentList.title }}
{{ currentList.title === '' ? $t('misc.loading') : getListTitle(currentList) }}
</h1>
<list-settings-dropdown v-if="canWriteCurrentList && currentList.id !== -1" :list="currentList"/>

View file

@ -35,15 +35,15 @@
<p class="has-text-centered has-text-grey is-italic" v-if="isPreviewActive && text === '' && emptyText !== ''">
{{ emptyText }}
<template v-if="isEditEnabled">
<a @click="toggleEdit">Edit</a>.
<a @click="toggleEdit">{{ $t('input.editor.edit') }}</a>.
</template>
</p>
<ul class="actions">
<template v-if="hasEditBottom && isEditEnabled">
<li>
<a v-if="!isEditActive" @click="toggleEdit">Edit</a>
<a v-else @click="toggleEdit">Done</a>
<a v-if="!isEditActive" @click="toggleEdit">{{ $t('input.editor.edit') }}</a>
<a v-else @click="toggleEdit">{{ $t('input.editor.done') }}</a>
</li>
</template>
<li v-for="(action, k) in bottomActions" :key="k">

View file

@ -130,7 +130,7 @@
</div>
<div class="field">
<label class="label">{{ $t('task.attributes.label') }}</label>
<label class="label">{{ $t('task.attributes.labels') }}</label>
<div class="control">
<multiselect
:placeholder="$t('label.search')"

View file

@ -9,7 +9,7 @@
<transition name="fade">
<div class="notifications-list" v-if="showNotifications" ref="popup">
<span class="head">Notifications</span>
<span class="head">{{ $t('notification.title') }}</span>
<div
v-for="(n, index) in notifications"
:key="n.id"

View file

@ -62,7 +62,7 @@
id="linkSharePassword"
type="password"
class="input"
:placeholder="$t('user.auth.passwortPlaceholder')"
:placeholder="$t('user.auth.passwordPlaceholder')"
v-tooltip="$t('list.share.links.passwordExplanation')"
v-model="password"
/>

View file

@ -0,0 +1,6 @@
export const getListTitle = (l, $t) => {
if (l.id === -1) {
return $t('list.pseudo.favorites.title');
}
return l.title;
}

View file

@ -0,0 +1,12 @@
export const getNamespaceTitle = (n, $t) => {
if (n.id === -1) {
return $t('namespace.pseudo.sharedLists.title');
}
if (n.id === -2) {
return $t('namespace.pseudo.favorites.title');
}
if (n.id === -3) {
return $t('namespace.pseudo.savedFilters.title');
}
return n.title;
}

View file

@ -245,6 +245,11 @@
"bucketTitleSavedSuccess": "The bucket title has been saved successfully.",
"bucketLimitSavedSuccess": "The bucket limit been saved successfully.",
"collapse": "Collapse this bucket"
},
"pseudo": {
"favorites": {
"title": "Favorites"
}
}
},
"namespace": {
@ -294,6 +299,17 @@
"color": "Color",
"archived": "Is Archived",
"isArchived": "This namespace is archived"
},
"pseudo": {
"sharedLists": {
"title": "Shared Lists"
},
"favorites": {
"title": "Favorites"
},
"savedFilters": {
"title": "Filters"
}
}
},
"filters": {
@ -414,6 +430,7 @@
"chooseDate": "Choose a date"
},
"editor": {
"edit": "Edit",
"done": "Done",
"heading1": "Heading 1",
"heading2": "Heading 2",
@ -716,6 +733,7 @@
"contact": "contact us"
},
"notification": {
"title": "Notifications",
"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."
},

View file

@ -85,6 +85,8 @@ import vueShortkey from 'vue-shortkey'
import message from './message'
import {colorIsDark} from './helpers/color/colorIsDark'
import {setTitle} from './helpers/setTitle'
import {getNamespaceTitle} from './helpers/getNamespaceTitle'
import {getListTitle} from './helpers/getListTitle'
// Vuex
import {store} from './store'
// i18n
@ -199,6 +201,12 @@ Vue.mixin({
formatDateShort(date) {
return formatDate(date, 'PPpp', this.$t('date.locale'))
},
getNamespaceTitle(n) {
return getNamespaceTitle(n, p => this.$t(p))
},
getListTitle(l) {
return getListTitle(l, p => this.$t(p))
},
error(e, actions = []) {
return message.error(e, this, p => this.$t(p), actions)
},

View file

@ -20,7 +20,6 @@ import attachments from './modules/attachments'
import labels from './modules/labels'
import ListService from '../services/list'
import {setTitle} from '@/helpers/setTitle'
Vue.use(Vuex)
@ -69,8 +68,6 @@ export const store = new Vuex.Store({
return
}
setTitle(currentList.title)
// Not sure if this is the right way to do it but hey, it works
if (
// List changed
@ -140,4 +137,4 @@ export const store = new Vuex.Store({
state.quickActionsActive = active
},
},
})
})

View file

@ -97,7 +97,7 @@ export default {
saveListToHistory(listData)
this.setTitle(this.currentList.title)
this.setTitle(this.currentList.id ? this.getListTitle(this.currentList) : '')
// This invalidates the loaded list at the kanban board which lets it reload its content when
// switched to it. This ensures updates done to tasks in the gantt or list views are consistently
@ -144,6 +144,7 @@ export default {
.then(r => {
this.$set(this, 'list', r)
this.$store.commit(CURRENT_LIST, r)
this.setTitle(this.getListTitle(r))
})
.catch(e => {
this.error(e)
@ -154,4 +155,4 @@ export default {
},
},
}
</script>
</script>

View file

@ -39,7 +39,7 @@
</x-button>
<h1>
<span>{{ n.title }}</span>
<span>{{ getNamespaceTitle(n) }}</span>
<span class="is-archived" v-if="n.isArchived">
{{ $t('namespace.archived') }}
</span>

View file

@ -3,9 +3,9 @@
<div class="task-view">
<heading v-model="task" :can-write="canWrite" ref="heading"/>
<h6 class="subtitle" v-if="parent && parent.namespace && parent.list">
{{ parent.namespace.title }} >
{{ getNamespaceTitle(parent.namespace) }} >
<router-link :to="{ name: listViewName, params: { listId: parent.list.id } }">
{{ parent.list.title }}
{{ getListTitle(parent.list) }}
</router-link>
</h6>