Add translation strings for misc components

This commit is contained in:
kolaente 2021-06-16 21:58:49 +02:00
parent 0927f699c0
commit 12283fefb2
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
8 changed files with 84 additions and 40 deletions

View File

@ -1,13 +1,13 @@
<template> <template>
<div class="api-config"> <div class="api-config">
<div v-if="configureApi"> <div v-if="configureApi">
<label class="label" for="api-url">Vikunja URL</label> <label class="label" for="api-url">{{ $t('apiConfig.url') }}</label>
<div class="field has-addons"> <div class="field has-addons">
<div class="control is-expanded"> <div class="control is-expanded">
<input <input
class="input" class="input"
id="api-url" id="api-url"
placeholder="eg. https://localhost:3456" :placeholder="$t('apiConfig.urlPlaceholder')"
required required
type="url" type="url"
v-focus v-focus
@ -17,16 +17,17 @@
</div> </div>
<div class="control"> <div class="control">
<x-button @click="setApiUrl" :disabled="apiUrl === ''"> <x-button @click="setApiUrl" :disabled="apiUrl === ''">
Change {{ $t('apiConfig.change') }}
</x-button> </x-button>
</div> </div>
</div> </div>
</div> </div>
<div class="api-url-info" v-else> <div class="api-url-info" v-else>
Sign in to your Vikunja account on <i18n path="apiConfig.signInOn">
<span v-tooltip="apiUrl"> {{ apiDomain() }} </span> <span class="url" v-tooltip="apiUrl"> {{ apiDomain() }} </span>
</i18n>
<br /> <br />
<a @click="() => (configureApi = true)">change</a> <a @click="() => (configureApi = true)">{{ $t('apiConfig.change') }}</a>
</div> </div>
<div <div
@ -178,14 +179,14 @@ export default {
.catch(() => { .catch(() => {
// Still not found, url is still invalid // Still not found, url is still invalid
this.successMsg = '' this.successMsg = ''
this.errorMsg = `Could not find or use Vikunja installation at "${this.apiDomain()}".` this.errorMsg = this.$t('apiConfig.error', {domain: this.apiDomain()})
window.API_URL = oldUrl window.API_URL = oldUrl
}) })
.then((r) => { .then((r) => {
if (typeof r !== 'undefined') { if (typeof r !== 'undefined') {
// Set it + save it to local storage to save us the hoops // Set it + save it to local storage to save us the hoops
this.errorMsg = '' this.errorMsg = ''
this.successMsg = `Using Vikunja installation at "${this.apiDomain()}".` this.successMsg = this.$t('apiConfig.success', {domain: this.apiDomain()})
localStorage.setItem('API_URL', window.API_URL) localStorage.setItem('API_URL', window.API_URL)
this.configureApi = false this.configureApi = false
this.apiUrl = window.API_URL this.apiUrl = window.API_URL

View File

@ -26,7 +26,7 @@
type="secondary" type="secondary"
@click.prevent.stop="$router.back()" @click.prevent.stop="$router.back()"
> >
Cancel {{ $t('misc.cancel') }}
</x-button> </x-button>
<x-button <x-button
type="primary" type="primary"
@ -52,7 +52,9 @@ export default {
}, },
primaryLabel: { primaryLabel: {
type: String, type: String,
default: 'Create', default() {
return this.$t('misc.create')
},
}, },
primaryIcon: { primaryIcon: {
type: String, type: String,

View File

@ -1,7 +1,9 @@
<template> <template>
<div class="notification is-danger"> <div class="notification is-danger">
Loading failed, please <a @click="() => location.reload()">try again</a>. <i18n path="loadingError.failed">
If the error persists, please <a href="https://vikunja.io/contact/">contact us</a>. <a @click="() => location.reload()">{{ $t('loadingError.tryAgain') }}</a>
<a href="https://vikunja.io/contact/">{{ $t('loadingError.contact') }}</a>
</i18n>
</div> </div>
</template> </template>

View File

@ -2,56 +2,56 @@
<div class="modal-mask keyboard-shortcuts-modal"> <div class="modal-mask keyboard-shortcuts-modal">
<div @click.self="close()" class="modal-container"> <div @click.self="close()" class="modal-container">
<div class="modal-content"> <div class="modal-content">
<card class="has-background-white has-no-shadow" title="Available Keyboard Shortcuts"> <card class="has-background-white has-no-shadow" :title="$t('keyboardShortcuts.title')">
<div class="message is-primary"> <div class="message is-primary">
<div class="message-body"> <div class="message-body">
These shortcuts work on all pages. {{ $t('keyboardShortcuts.allPages') }}
</div> </div>
</div> </div>
<p> <p>
<strong>Toggle The Menu</strong> <strong>{{ $t('keyboardShortcuts.toggleMenu') }}</strong>
<shortcut :keys="['ctrl', 'e']"/> <shortcut :keys="['ctrl', 'e']"/>
</p> </p>
<p> <p>
<strong>Open the search/quick action bar</strong> <strong>{{ $t('keyboardShortcuts.quickSearch') }}</strong>
<shortcut :keys="['ctrl', 'k']"/> <shortcut :keys="['ctrl', 'k']"/>
</p> </p>
<h3>Kanban</h3> <h3>{{ $t('list.kanban.title') }}</h3>
<div class="message is-primary" v-if="$route.name === 'list.kanban'"> <div class="message is-primary" v-if="$route.name === 'list.kanban'">
<div class="message-body"> <div class="message-body">
These shortcuts work only on the current page. {{ $t('keyboardShortcuts.currentPageOnly') }}
</div> </div>
</div> </div>
<p> <p>
<strong>Mark a task as done</strong> <strong>{{ $t('keyboardShortcuts.task.done') }}</strong>
<shortcut :keys="['ctrl', 'click']"/> <shortcut :keys="['ctrl', 'click']"/>
</p> </p>
<h3>Task Page</h3> <h3>{{ $t('keyboardShortcuts.task.title') }}</h3>
<div <div
class="message is-primary" class="message is-primary"
v-if="$route.name === 'task.detail' || $route.name === 'task.list.detail' || $route.name === 'task.gantt.detail' || $route.name === 'task.kanban.detail' || $route.name === 'task.detail'"> v-if="$route.name === 'task.detail' || $route.name === 'task.list.detail' || $route.name === 'task.gantt.detail' || $route.name === 'task.kanban.detail' || $route.name === 'task.detail'">
<div class="message-body"> <div class="message-body">
These shortcuts work only on the current page. {{ $t('keyboardShortcuts.currentPageOnly') }}
</div> </div>
</div> </div>
<p> <p>
<strong>Assign this task to a user</strong> <strong>{{ $t('keyboardShortcuts.task.assign') }}</strong>
<shortcut :keys="['a']"/> <shortcut :keys="['a']"/>
</p> </p>
<p> <p>
<strong>Add labels to this task</strong> <strong>{{ $t('keyboardShortcuts.task.labels') }}</strong>
<shortcut :keys="['l']"/> <shortcut :keys="['l']"/>
</p> </p>
<p> <p>
<strong>Change the due date of this task</strong> <strong>{{ $t('keyboardShortcuts.task.dueDate') }}</strong>
<shortcut :keys="['d']"/> <shortcut :keys="['d']"/>
</p> </p>
<p> <p>
<strong>Add an attachment to this task</strong> <strong>{{ $t('keyboardShortcuts.task.attachment') }}</strong>
<shortcut :keys="['f']"/> <shortcut :keys="['f']"/>
</p> </p>
<p> <p>
<strong>Modify related tasks of this task</strong> <strong>{{ $t('keyboardShortcuts.task.related') }}</strong>
<shortcut :keys="['r']"/> <shortcut :keys="['r']"/>
</p> </p>
</card> </card>

View File

@ -1,8 +1,8 @@
<template> <template>
<div class="legal-links"> <div class="legal-links">
<a :href="imprintUrl" target="_blank" v-if="imprintUrl">Imprint</a> <a :href="imprintUrl" target="_blank" v-if="imprintUrl">{{ $t('navigation.imprint') }}</a>
<span v-if="imprintUrl && privacyPolicyUrl"> | </span> <span v-if="imprintUrl && privacyPolicyUrl"> | </span>
<a :href="privacyPolicyUrl" target="_blank" v-if="privacyPolicyUrl">Privacy policy</a> <a :href="privacyPolicyUrl" target="_blank" v-if="privacyPolicyUrl">{{ $t('navigation.privacy') }}</a>
</div> </div>
</template> </template>

View File

@ -54,16 +54,19 @@ export default {
}, },
computed: { computed: {
tooltipText() { tooltipText() {
if(this.disabled) { if (this.disabled) {
return `You can't unsubscribe here because you are subscribed to this ${this.entity} through its ${this.subscription.entity}.` return this.$t('task.subscription.subscribedThroughParent', {
entity: this.entity,
parent: this.subscription.entity
})
} }
return this.subscription !== null ? return this.subscription !== null ?
`You are currently subscribed to this ${this.entity} and will receive notifications for changes.` : this.$t('task.subscription.subscribed', {entity: this.entity}) :
`You are not subscribed to this ${this.entity} and won't receive notifications for changes.` this.$t('task.subscription.notSubscribed', {entity: this.entity})
}, },
buttonText() { buttonText() {
return this.subscription !== null ? 'Unsubscribe' : 'Subscribe' return this.subscription !== null ? this.$t('task.subscription.unsubscribe') : this.$t('task.subscription.subscribe')
}, },
icon() { icon() {
return this.subscription !== null ? ['far', 'bell-slash'] : 'bell' return this.subscription !== null ? ['far', 'bell-slash'] : 'bell'
@ -78,7 +81,7 @@ export default {
}, },
methods: { methods: {
changeSubscription() { changeSubscription() {
if(this.disabled) { if (this.disabled) {
return return
} }
@ -96,7 +99,7 @@ export default {
this.subscriptionService.create(subscription) this.subscriptionService.create(subscription)
.then(() => { .then(() => {
this.$emit('change', subscription) this.$emit('change', subscription)
this.success({message: `You are now subscribed to this ${this.entity}`}, this) this.success({message: this.$t('task.subscription.subscribeSuccess', {entity: this.entity})}, this)
}) })
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)
@ -110,7 +113,7 @@ export default {
this.subscriptionService.delete(subscription) this.subscriptionService.delete(subscription)
.then(() => { .then(() => {
this.$emit('change', null) this.$emit('change', null)
this.success({message: `You are now unsubscribed to this ${this.entity}`}, this) this.success({message: this.$t('task.subscription.unsubscribeSuccess', {entity: this.entity})}, this)
}) })
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)

View File

@ -331,7 +331,8 @@
"previous": "Previous", "previous": "Previous",
"next": "Next", "next": "Next",
"poweredBy": "Powered by Vikunja", "poweredBy": "Powered by Vikunja",
"info": "Info" "info": "Info",
"create": "Create"
}, },
"input": { "input": {
"resetColor": "Reset Color", "resetColor": "Reset Color",
@ -438,6 +439,15 @@
"startDate": "Start Date", "startDate": "Start Date",
"title": "Title", "title": "Title",
"updated": "Updated" "updated": "Updated"
},
"subscription": {
"subscribedThroughParent": "You can't unsubscribe here because you are subscribed to this {entity} through its {parent}.",
"subscribed": "You are currently subscribed to this {entity} and will receive notifications for changes.",
"notSubscribed": "You are not subscribed to this {entity} and won't receive notifications for changes.",
"subscribe": "Subscribe",
"unsubscribe": "Unsubscribe",
"subscribeSuccess": "You are now subscribed to this {entity}",
"unsubscribeSuccess": "You are now unsubscribed to this {entity}"
} }
}, },
"team": { "team": {
@ -482,13 +492,26 @@
} }
}, },
"keyboardShortcuts": { "keyboardShortcuts": {
"title": "Keyboard Shortcuts" "title": "Keyboard Shortcuts",
"allPages": "These shortcuts work on all pages.",
"currentPageOnly": "These shortcuts work only on the current page.",
"toggleMenu": "Toggle The Menu",
"quickSearch": "Open the search/quick action bar",
"task": {
"title": "Task Page",
"done": "Mark a task as done",
"assign": "Assign this task to a user",
"labels": "Add labels to this task",
"dueDate": "Change the due date of this task",
"attachment": "Add an attachment to this task",
"related": "Modify related tasks of this task"
}
}, },
"update": { "update": {
"available": "There is an update for Vikunja available!", "available": "There is an update for Vikunja available!",
"do": "Update Now" "do": "Update Now"
}, },
"menu":{ "menu": {
"edit": "Edit", "edit": "Edit",
"archive": "Archive", "archive": "Archive",
"duplicate": "Duplicate", "duplicate": "Duplicate",
@ -496,5 +519,18 @@
"unarchive": "Un-Archive", "unarchive": "Un-Archive",
"setBackground": "Set background", "setBackground": "Set background",
"share": "Share" "share": "Share"
},
"apiConfig": {
"url": "Vikunja URL",
"urlPlaceholder": "eg. https://localhost:3456",
"change": "change",
"signInOn": "Sign in to your Vikunja account on {0}",
"error": "Could not find or use Vikunja installation at \"{domain}\".",
"success": "Using Vikunja installation at \"{domain}\"."
},
"loadingError": {
"failed": "Loading failed, please {0}. If the error persists, please {1}.",
"tryAgain": "try again",
"contact": "contact us"
} }
} }

View File

@ -6,7 +6,7 @@
font-size: .9rem; font-size: .9rem;
text-align: right; text-align: right;
span { span.url {
border-bottom: 1px dashed $primary; border-bottom: 1px dashed $primary;
} }
} }