1
0

Add translations (#562)

Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/562
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
This commit is contained in:
konrad
2021-06-23 23:24:57 +00:00
parent 5badb65037
commit f0498fd767
103 changed files with 2306 additions and 973 deletions

View File

@ -1,72 +1,76 @@
<template>
<div>
<p class="has-text-weight-bold">
Share Links
{{ $t('list.share.links.title') }}
<span
class="is-size-7"
v-tooltip="'Share Links allow you to easily share a list with other users who don\'t have an account on Vikunja.'">
What is a share link?
v-tooltip="$t('list.share.links.explanation')">
{{ $t('list.share.links.what') }}
</span>
</p>
<div class="sharables-list">
<x-button
v-if="!(linkShares.length === 0 || showNewForm)"
@click="showNewForm = true"
icon="plus"
class="mb-4">
Create a new link share
{{ $t('list.share.links.create') }}
</x-button>
<div class="p-4" v-if="linkShares.length === 0 || showNewForm">
<div class="field">
<label class="label" for="linkShareRight">
Right
{{ $t('list.share.right.title') }}
</label>
<div class="control">
<div class="select">
<select v-model="selectedRight" id="linkShareRight">
<option :value="rights.READ">Read only</option>
<option :value="rights.READ_WRITE">
Read & write
<option :value="rights.READ">
{{ $t('list.share.right.read') }}
</option>
<option :value="rights.READ_WRITE">
{{ $t('list.share.right.readWrite') }}
</option>
<option :value="rights.ADMIN">
{{ $t('list.share.right.admin') }}
</option>
<option :value="rights.ADMIN">Admin</option>
</select>
</div>
</div>
</div>
<div class="field">
<label class="label" for="linkShareName">
Name (optional)
{{ $t('list.share.links.name') }}
</label>
<div class="control">
<input
id="linkShareName"
class="input"
placeholder="e.g. Lorem Ipsum"
v-tooltip="'All actions done by this link share will show up with the name.'"
:placeholder="$t('list.share.links.namePlaceholder')"
v-tooltip="$t('list.share.links.nameExplanation')"
v-model="name"
/>
</div>
</div>
<div class="field">
<label class="label" for="linkSharePassword">
Password (optional)
{{ $t('list.share.links.password') }}
</label>
<div class="control">
<input
id="linkSharePassword"
type="password"
class="input"
placeholder="e.g. ••••••••••••"
v-tooltip="'When authenticating, the user will be required to enter this password.'"
:placeholder="$t('user.auth.passwortPlaceholder')"
v-tooltip="$t('list.share.links.passwordExplanation')"
v-model="password"
/>
</div>
</div>
<x-button @click="add" icon="plus">Share</x-button>
<x-button @click="add" icon="plus">
{{ $t('list.share.share') }}
</x-button>
</div>
<table
@ -75,11 +79,11 @@
>
<thead>
<tr>
<th>Link</th>
<th>Name</th>
<th>Shared&nbsp;by</th>
<th>Right</th>
<th>Delete</th>
<th>{{ $t('list.share.attributes.link') }}</th>
<th>{{ $t('list.share.attributes.name') }}</th>
<th>{{ $t('list.share.attributes.sharedBy') }}</th>
<th>{{ $t('list.share.attributes.right') }}</th>
<th>{{ $t('list.share.attributes.delete') }}</th>
</tr>
</thead>
<tbody>
@ -98,7 +102,7 @@
<x-button
@click="copy(getShareLink(s.hash))"
:shadow="false"
v-tooltip="'Copy to clipboard'"
v-tooltip="$t('misc.copy')"
>
<span class="icon">
<icon icon="paste"/>
@ -111,7 +115,7 @@
<template v-if="s.name !== ''">
{{ s.name }}
</template>
<i v-else>No name set</i>
<i v-else>{{ $t('list.share.links.noName') }}</i>
</td>
<td>
{{ s.sharedBy.getDisplayName() }}
@ -121,19 +125,19 @@
<span class="icon is-small">
<icon icon="lock"/>
</span>&nbsp;
Admin
{{ $t('list.share.right.admin') }}
</template>
<template v-else-if="s.right === rights.READ_WRITE">
<span class="icon is-small">
<icon icon="pen"/>
</span>&nbsp;
Write
{{ $t('list.share.right.readWrite') }}
</template>
<template v-else>
<span class="icon is-small">
<icon icon="users"/>
</span>&nbsp;
Read-only
{{ $t('list.share.right.read') }}
</template>
</td>
<td class="actions">
@ -159,12 +163,9 @@
@submit="remove()"
v-if="showDeleteModal"
>
<span slot="header">Remove a link share</span>
<span slot="header">{{ $t('list.share.links.remove') }}</span>
<p slot="text">
Are you sure you want to remove this link share?<br/>
It will no longer be possible to access this list with this link
share.<br/>
<b>This CANNOT BE UNDONE!</b>
{{ $t('list.share.links.removeText') }}
</p>
</modal>
</transition>
@ -248,7 +249,7 @@ export default {
this.name = ''
this.password = ''
this.showNewForm = false
this.success({message: 'The link share was successfully created'})
this.success({message: this.$t('list.share.links.createSuccess')})
this.load()
})
.catch((e) => {
@ -263,7 +264,7 @@ export default {
this.linkShareService
.delete(linkshare)
.then(() => {
this.success({message: 'The link share was successfully deleted'})
this.success({message: this.$t('list.share.links.deleteSuccess')})
this.load()
})
.catch((e) => {

View File

@ -1,6 +1,8 @@
<template>
<div>
<p class="has-text-weight-bold">Shared with these {{ shareType }}s</p>
<p class="has-text-weight-bold">
{{ $t('list.share.userTeam.shared', {type: shareTypeNames}) }}
</p>
<div v-if="userIsAdmin">
<div class="field has-addons">
<p
@ -9,7 +11,7 @@
>
<multiselect
:loading="searchService.loading"
placeholder="Type to search..."
:placeholder="$t('misc.searchPlaceholder')"
@search="find"
:search-results="found"
:label="searchLabel"
@ -17,7 +19,7 @@
/>
</p>
<p class="control">
<x-button @click="add()"> Share</x-button>
<x-button @click="add()">{{ $t('list.share.share') }}</x-button>
</p>
</div>
</div>
@ -29,7 +31,7 @@
<td>{{ s.getDisplayName() }}</td>
<td>
<template v-if="s.id === userInfo.id">
<b class="is-success">You</b>
<b class="is-success">{{ $t('list.share.userTeam.you') }}</b>
</template>
</td>
</template>
@ -50,19 +52,19 @@
<span class="icon is-small">
<icon icon="lock"/>
</span>
Admin
{{ $t('list.share.right.admin') }}
</template>
<template v-else-if="s.right === rights.READ_WRITE">
<span class="icon is-small">
<icon icon="pen"/>
</span>
Write
{{ $t('list.share.right.readWrite') }}
</template>
<template v-else>
<span class="icon is-small">
<icon icon="users"/>
</span>
Read-only
{{ $t('list.share.right.read') }}
</template>
</td>
<td class="actions" v-if="userIsAdmin">
@ -76,19 +78,19 @@
:selected="s.right === rights.READ"
:value="rights.READ"
>
Read only
{{ $t('list.share.right.read') }}
</option>
<option
:selected="s.right === rights.READ_WRITE"
:value="rights.READ_WRITE"
>
Read & write
{{ $t('list.share.right.readWrite') }}
</option>
<option
:selected="s.right === rights.ADMIN"
:value="rights.ADMIN"
>
Admin
{{ $t('list.share.right.admin') }}
</option>
</select>
</div>
@ -108,7 +110,7 @@
</table>
<nothing v-else>
Not shared with any {{ shareType }} yet.
{{ $t('list.share.userTeam.notShared', {type: shareTypeNames}) }}
</nothing>
<transition name="modal">
@ -117,13 +119,11 @@
@submit="deleteSharable()"
v-if="showDeleteModal"
>
<span slot="header"
>Remove a {{ shareType }} from the {{ typeString }}</span
>
<span slot="header">
{{ $t('list.share.userTeam.removeHeader', {type: shareTypeName, sharable: sharableName}) }}
</span>
<p slot="text">
Are you sure you want to remove this {{ shareType }} from the
{{ typeString }}?<br/>
<b>This CANNOT BE UNDONE!</b>
{{ $t('list.share.userTeam.removeText', {type: shareTypeName, sharable: sharableName}) }}
</p>
</modal>
</transition>
@ -131,8 +131,6 @@
</template>
<script>
import {mapState} from 'vuex'
import UserNamespaceService from '../../services/userNamespace'
import UserNamespaceModel from '../../models/userNamespace'
import UserListModel from '../../models/userList'
@ -192,9 +190,44 @@ export default {
Nothing,
Multiselect,
},
computed: mapState({
userInfo: (state) => state.auth.info,
}),
computed: {
userInfo() {
return this.$store.state.auth.info
},
shareTypeNames() {
if (this.shareType === 'user') {
return this.$tc('list.share.userTeam.typeUser', 2)
}
if (this.shareType === 'team') {
return this.$tc('list.share.userTeam.typeTeam', 2)
}
return ''
},
shareTypeName() {
if (this.shareType === 'user') {
return this.$tc('list.share.userTeam.typeUser', 1)
}
if (this.shareType === 'team') {
return this.$tc('list.share.userTeam.typeTeam', 1)
}
return ''
},
sharableName() {
if (this.type === 'list') {
return this.$t('list.list.title')
}
if (this.shareType === 'namespace') {
return this.$t('namespace.namespace')
}
return ''
},
},
created() {
if (this.shareType === 'user') {
this.searchService = new UserService()
@ -271,7 +304,7 @@ export default {
this.sharables.splice(i, 1)
}
}
this.success({message: `The ${this.shareType} was successfully deleted from the ${this.typeString}.`})
this.success({message: this.$t('list.share.userTeam.removeSuccess', {type: this.shareTypeName, sharable: this.sharableName})})
})
.catch((e) => {
this.error(e)
@ -295,12 +328,7 @@ export default {
this.stuffService
.create(this.stuffModel)
.then(() => {
this.success({
message:
'The ' +
this.shareType +
' was successfully added.',
})
this.success({message: this.$t('list.share.userTeam.addedSuccess', {type: this.shareTypeName})})
this.load()
})
.catch((e) => {
@ -337,12 +365,7 @@ export default {
this.$set(this.sharables[i], 'right', r.right)
}
}
this.success({
message:
'The ' +
this.shareType +
' right was successfully updated.',
})
this.success({message: this.$t('list.share.userTeam.updatedSuccess', {type: this.shareTypeName})})
})
.catch((e) => {
this.error(e)