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

View file

@ -30,7 +30,7 @@
<h1 <h1
:style="{ 'opacity': currentList.title === '' ? '0': '1' }" :style="{ 'opacity': currentList.title === '' ? '0': '1' }"
class="title"> class="title">
{{ currentList.title === '' ? $t('misc.loading') : currentList.title }} {{ currentList.title === '' ? $t('misc.loading') : getListTitle(currentList) }}
</h1> </h1>
<list-settings-dropdown v-if="canWriteCurrentList && currentList.id !== -1" :list="currentList"/> <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 !== ''"> <p class="has-text-centered has-text-grey is-italic" v-if="isPreviewActive && text === '' && emptyText !== ''">
{{ emptyText }} {{ emptyText }}
<template v-if="isEditEnabled"> <template v-if="isEditEnabled">
<a @click="toggleEdit">Edit</a>. <a @click="toggleEdit">{{ $t('input.editor.edit') }}</a>.
</template> </template>
</p> </p>
<ul class="actions"> <ul class="actions">
<template v-if="hasEditBottom && isEditEnabled"> <template v-if="hasEditBottom && isEditEnabled">
<li> <li>
<a v-if="!isEditActive" @click="toggleEdit">Edit</a> <a v-if="!isEditActive" @click="toggleEdit">{{ $t('input.editor.edit') }}</a>
<a v-else @click="toggleEdit">Done</a> <a v-else @click="toggleEdit">{{ $t('input.editor.done') }}</a>
</li> </li>
</template> </template>
<li v-for="(action, k) in bottomActions" :key="k"> <li v-for="(action, k) in bottomActions" :key="k">

View file

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

View file

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

View file

@ -62,7 +62,7 @@
id="linkSharePassword" id="linkSharePassword"
type="password" type="password"
class="input" class="input"
:placeholder="$t('user.auth.passwortPlaceholder')" :placeholder="$t('user.auth.passwordPlaceholder')"
v-tooltip="$t('list.share.links.passwordExplanation')" v-tooltip="$t('list.share.links.passwordExplanation')"
v-model="password" 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.", "bucketTitleSavedSuccess": "The bucket title has been saved successfully.",
"bucketLimitSavedSuccess": "The bucket limit been saved successfully.", "bucketLimitSavedSuccess": "The bucket limit been saved successfully.",
"collapse": "Collapse this bucket" "collapse": "Collapse this bucket"
},
"pseudo": {
"favorites": {
"title": "Favorites"
}
} }
}, },
"namespace": { "namespace": {
@ -294,6 +299,17 @@
"color": "Color", "color": "Color",
"archived": "Is Archived", "archived": "Is Archived",
"isArchived": "This namespace is archived" "isArchived": "This namespace is archived"
},
"pseudo": {
"sharedLists": {
"title": "Shared Lists"
},
"favorites": {
"title": "Favorites"
},
"savedFilters": {
"title": "Filters"
}
} }
}, },
"filters": { "filters": {
@ -414,6 +430,7 @@
"chooseDate": "Choose a date" "chooseDate": "Choose a date"
}, },
"editor": { "editor": {
"edit": "Edit",
"done": "Done", "done": "Done",
"heading1": "Heading 1", "heading1": "Heading 1",
"heading2": "Heading 2", "heading2": "Heading 2",
@ -716,6 +733,7 @@
"contact": "contact us" "contact": "contact us"
}, },
"notification": { "notification": {
"title": "Notifications",
"none": "You don't have any notifications. Have a nice day!", "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." "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 message from './message'
import {colorIsDark} from './helpers/color/colorIsDark' import {colorIsDark} from './helpers/color/colorIsDark'
import {setTitle} from './helpers/setTitle' import {setTitle} from './helpers/setTitle'
import {getNamespaceTitle} from './helpers/getNamespaceTitle'
import {getListTitle} from './helpers/getListTitle'
// Vuex // Vuex
import {store} from './store' import {store} from './store'
// i18n // i18n
@ -199,6 +201,12 @@ Vue.mixin({
formatDateShort(date) { formatDateShort(date) {
return formatDate(date, 'PPpp', this.$t('date.locale')) 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 = []) { error(e, actions = []) {
return message.error(e, this, p => this.$t(p), 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 labels from './modules/labels'
import ListService from '../services/list' import ListService from '../services/list'
import {setTitle} from '@/helpers/setTitle'
Vue.use(Vuex) Vue.use(Vuex)
@ -69,8 +68,6 @@ export const store = new Vuex.Store({
return return
} }
setTitle(currentList.title)
// Not sure if this is the right way to do it but hey, it works // Not sure if this is the right way to do it but hey, it works
if ( if (
// List changed // List changed
@ -140,4 +137,4 @@ export const store = new Vuex.Store({
state.quickActionsActive = active state.quickActionsActive = active
}, },
}, },
}) })

View file

@ -97,7 +97,7 @@ export default {
saveListToHistory(listData) 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 // 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 // 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 => { .then(r => {
this.$set(this, 'list', r) this.$set(this, 'list', r)
this.$store.commit(CURRENT_LIST, r) this.$store.commit(CURRENT_LIST, r)
this.setTitle(this.getListTitle(r))
}) })
.catch(e => { .catch(e => {
this.error(e) this.error(e)
@ -154,4 +155,4 @@ export default {
}, },
}, },
} }
</script> </script>

View file

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

View file

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