Added translation strings context

This commit is contained in:
Jo Vuit 2019-02-11 14:22:22 +01:00
parent fbb8e1a227
commit 036d94a41a
1 changed files with 32 additions and 32 deletions

View File

@ -3,23 +3,23 @@
<div class="ui inline form"> <div class="ui inline form">
<div class="fields"> <div class="fields">
<div class="ui six wide field"> <div class="ui six wide field">
<label><translate>Search</translate></label> <label><translate :translate-context="'Content/Library/Input.Label/Verb'">Search</translate></label>
<form @submit.prevent="search.query = $refs.search.value"> <form @submit.prevent="search.query = $refs.search.value">
<input name="search" ref="search" type="text" :value="search.query" :placeholder="labels.searchPlaceholder" /> <input name="search" ref="search" type="text" :value="search.query" :placeholder="labels.searchPlaceholder" />
</form> </form>
</div> </div>
<div class="field"> <div class="field">
<label><translate>Import status</translate></label> <label><translate :translate-context="'Content/Library/Dropdown.Label/Noun'">Import status</translate></label>
<select class="ui dropdown" @change="addSearchToken('status', $event.target.value)" :value="getTokenValue('status', '')"> <select class="ui dropdown" @change="addSearchToken('status', $event.target.value)" :value="getTokenValue('status', '')">
<option value=""><translate>All</translate></option> <option value=""><translate :translate-context="'Content/Library/Dropdown'">All</translate></option>
<option value="pending"><translate>Pending</translate></option> <option value="pending"><translate :translate-context="'Content/Library/Dropdown'">Pending</translate></option>
<option value="skipped"><translate>Skipped</translate></option> <option value="skipped"><translate :translate-context="'Content/Library/Dropdown'">Skipped</translate></option>
<option value="errored"><translate>Failed</translate></option> <option value="errored"><translate :translate-context="'Content/Library/Dropdown'">Failed</translate></option>
<option value="finished"><translate>Finished</translate></option> <option value="finished"><translate :translate-context="'Content/Library/Dropdown'">Finished</translate></option>
</select> </select>
</div> </div>
<div class="field"> <div class="field">
<label><translate>Ordering</translate></label> <label><translate :translate-context="'Content/Library/Dropdown.Label/Noun'">Ordering</translate></label>
<select class="ui dropdown" v-model="ordering"> <select class="ui dropdown" v-model="ordering">
<option v-for="option in orderingOptions" :value="option[0]"> <option v-for="option in orderingOptions" :value="option[0]">
{{ sharedLabels.filters[option[1]] }} {{ sharedLabels.filters[option[1]] }}
@ -27,10 +27,10 @@
</select> </select>
</div> </div>
<div class="field"> <div class="field">
<label><translate>Ordering direction</translate></label> <label><translate :translate-context="'Content/Library/Dropdown.Label/Noun'">Ordering direction</translate></label>
<select class="ui dropdown" v-model="orderingDirection"> <select class="ui dropdown" v-model="orderingDirection">
<option value="+"><translate>Ascending</translate></option> <option value="+"><translate :translate-context="'Content/Library/Dropdown'">Ascending</translate></option>
<option value="-"><translate>Descending</translate></option> <option value="-"><translate :translate-context="'Content/Library/Dropdown'">Descending</translate></option>
</select> </select>
</div> </div>
</div> </div>
@ -52,13 +52,13 @@
@refresh="fetchData" @refresh="fetchData"
:filters="actionFilters"> :filters="actionFilters">
<template slot="header-cells"> <template slot="header-cells">
<th><translate>Title</translate></th> <th><translate :translate-context="'*/*/*'">Title</translate></th>
<th><translate>Artist</translate></th> <th><translate :translate-context="'*/*/*'">Artist</translate></th>
<th><translate>Album</translate></th> <th><translate :translate-context="'*/*/*'">Album</translate></th>
<th><translate>Upload date</translate></th> <th><translate :translate-context="'*/*/*/Noun'">Upload date</translate></th>
<th><translate>Import status</translate></th> <th><translate :translate-context="'*/*/*/Noun'">Import status</translate></th>
<th><translate>Duration</translate></th> <th><translate :translate-context="'*/*/*'">Duration</translate></th>
<th><translate>Size</translate></th> <th><translate :translate-context="'*/*/*'">Size</translate></th>
</template> </template>
<template slot="row-cells" slot-scope="scope"> <template slot="row-cells" slot-scope="scope">
<template v-if="scope.obj.track"> <template v-if="scope.obj.track">
@ -90,13 +90,13 @@
{{ time.parse(scope.obj.duration) }} {{ time.parse(scope.obj.duration) }}
</td> </td>
<td v-else> <td v-else>
<translate>N/A</translate> <translate :translate-context="'*/*/*'">N/A</translate>
</td> </td>
<td v-if="scope.obj.size"> <td v-if="scope.obj.size">
{{ scope.obj.size | humanSize }} {{ scope.obj.size | humanSize }}
</td> </td>
<td v-else> <td v-else>
<translate>N/A</translate> <translate :translate-context="'*/*/*'">N/A</translate>
</td> </td>
</template> </template>
</action-table> </action-table>
@ -112,7 +112,7 @@
></pagination> ></pagination>
<span v-if="result && result.results.length > 0"> <span v-if="result && result.results.length > 0">
<translate <translate :translate-context="'Content/Library/Paragraph'"
:translate-params="{start: ((page-1) * paginateBy) + 1, end: ((page-1) * paginateBy) + result.results.length, total: result.count}"> :translate-params="{start: ((page-1) * paginateBy) + 1, end: ((page-1) * paginateBy) + result.results.length, total: result.count}">
Showing results %{ start }-%{ end } on %{ total } Showing results %{ start }-%{ end } on %{ total }
</translate> </translate>
@ -198,23 +198,23 @@ export default {
computed: { computed: {
labels () { labels () {
return { return {
searchPlaceholder: this.$gettext('Search by title, artist, album…'), searchPlaceholder: this.$pgettext('Content/Library/Input.Placeholder', 'Search by title, artist, album…'),
importStatuses: { importStatuses: {
skipped: { skipped: {
label: this.$gettext('Skipped'), label: this.$pgettext('Content/Library/Table/Short', 'Skipped'),
help: this.$gettext('Track already present in one of your libraries'), help: this.$pgettext('Content/Library/Help text', 'Track already present in one of your libraries'),
}, },
pending: { pending: {
label: this.$gettext('Pending'), label: this.$pgettext('Content/Library/Table/Short', 'Pending'),
help: this.$gettext('Track uploaded, but not processed by the server yet'), help: this.$pgettext('Content/Library/Help text', 'Track uploaded, but not processed by the server yet'),
}, },
errored: { errored: {
label: this.$gettext('Errored'), label: this.$pgettext('Content/Library/Table/Short', 'Errored'),
help: this.$gettext('Could not process this track, ensure it is tagged correctly'), help: this.$pgettext('Content/Library/Help text', 'Could not process this track, ensure it is tagged correctly'),
}, },
finished: { finished: {
label: this.$gettext('Finished'), label: this.$pgettext('Content/Library/Table/Short', 'Finished'),
help: this.$gettext('Imported'), help: this.$pgettext('Content/Library/Help text', 'Imported'),
}, },
} }
} }
@ -230,8 +230,8 @@ export default {
} }
}, },
actions () { actions () {
let deleteMsg = this.$gettext('Delete') let deleteMsg = this.$pgettext('Content/Library/Dropdown/Verb', 'Delete')
let relaunchMsg = this.$gettext('Relaunch import') let relaunchMsg = this.$pgettext('Content/Library/Dropdown/Verb', 'Relaunch import')
return [ return [
{ {
name: 'delete', name: 'delete',