Merge branch '662-library' into 'develop'

#662: Resolve "Add contexts to translatable strings"

See merge request funkwhale/funkwhale!616
merge-requests/622/head
Eliot Berriot 2019-02-14 10:40:20 +01:00
commit d4d4e60e39
10 zmienionych plików z 126 dodań i 126 usunięć

Wyświetl plik

@ -2,18 +2,18 @@
<main v-title="labels.title"> <main v-title="labels.title">
<section class="ui vertical stripe segment"> <section class="ui vertical stripe segment">
<h2 class="ui header"> <h2 class="ui header">
<translate>Browsing albums</translate> <translate :translate-context="'Content/Album/Title'">Browsing albums</translate>
</h2> </h2>
<div :class="['ui', {'loading': isLoading}, 'form']"> <div :class="['ui', {'loading': isLoading}, 'form']">
<div class="fields"> <div class="fields">
<div class="field"> <div class="field">
<label> <label>
<translate>Search</translate> <translate :translate-context="'Content/Search/Input.Label/Verb'">Search</translate>
</label> </label>
<input type="text" name="search" v-model="query" :placeholder="labels.searchPlaceholder"/> <input type="text" name="search" v-model="query" :placeholder="labels.searchPlaceholder"/>
</div> </div>
<div class="field"> <div class="field">
<label><translate>Ordering</translate></label> <label><translate :translate-context="'Content/Search/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]] }}
@ -21,14 +21,14 @@
</select> </select>
</div> </div>
<div class="field"> <div class="field">
<label><translate>Ordering direction</translate></label> <label><translate :translate-context="'Content/Search/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/Search/Dropdown'">Ascending</translate></option>
<option value="-"><translate>Descending</translate></option> <option value="-"><translate :translate-context="'Content/Search/Dropdown'">Descending</translate></option>
</select> </select>
</div> </div>
<div class="field"> <div class="field">
<label><translate>Results per page</translate></label> <label><translate :translate-context="'Content/Search/Dropdown.Label/Noun'">Results per page</translate></label>
<select class="ui dropdown" v-model="paginateBy"> <select class="ui dropdown" v-model="paginateBy">
<option :value="parseInt(12)">12</option> <option :value="parseInt(12)">12</option>
<option :value="parseInt(25)">25</option> <option :value="parseInt(25)">25</option>
@ -116,8 +116,8 @@ export default {
}, },
computed: { computed: {
labels() { labels() {
let searchPlaceholder = this.$gettext("Enter album title...") let searchPlaceholder = this.$pgettext('Content/Search/Input.Placeholder', "Enter album title...")
let title = this.$gettext("Albums") let title = this.$pgettext('Head/Album/Title', "Albums")
return { return {
searchPlaceholder, searchPlaceholder,
title title

Wyświetl plik

@ -11,7 +11,7 @@
<div class="content"> <div class="content">
{{ artist.name }} {{ artist.name }}
<div class="sub header" v-if="albums"> <div class="sub header" v-if="albums">
<translate <translate :translate-context="'Content/Artist/Paragraph'"
tag="div" tag="div"
translate-plural="%{ count } tracks in %{ albumsCount } albums" translate-plural="%{ count } tracks in %{ albumsCount } albums"
:translate-n="totalTracks" :translate-n="totalTracks"
@ -24,16 +24,16 @@
<div class="ui hidden divider"></div> <div class="ui hidden divider"></div>
<radio-button type="artist" :object-id="artist.id"></radio-button> <radio-button type="artist" :object-id="artist.id"></radio-button>
<play-button :is-playable="isPlayable" class="orange" :artist="artist.id"> <play-button :is-playable="isPlayable" class="orange" :artist="artist.id">
<translate>Play all albums</translate> <translate :translate-context="'Content/Artist/Button.Label/Verb'">Play all albums</translate>
</play-button> </play-button>
<a :href="wikipediaUrl" target="_blank" class="ui button"> <a :href="wikipediaUrl" target="_blank" class="ui button">
<i class="wikipedia w icon"></i> <i class="wikipedia w icon"></i>
<translate>Search on Wikipedia</translate> <translate :translate-context="'Content/*/Button.Label/Verb'">Search on Wikipedia</translate>
</a> </a>
<a v-if="musicbrainzUrl" :href="musicbrainzUrl" target="_blank" class="ui button"> <a v-if="musicbrainzUrl" :href="musicbrainzUrl" target="_blank" class="ui button">
<i class="external icon"></i> <i class="external icon"></i>
<translate>View on MusicBrainz</translate> <translate :translate-context="'Content/*/Button.Label/Verb'">View on MusicBrainz</translate>
</a> </a>
</div> </div>
</section> </section>
@ -42,7 +42,7 @@
</section> </section>
<section v-else-if="albums && albums.length > 0" class="ui vertical stripe segment"> <section v-else-if="albums && albums.length > 0" class="ui vertical stripe segment">
<h2> <h2>
<translate>Albums by this artist</translate> <translate :translate-context="'Content/Artist/Title'">Albums by this artist</translate>
</h2> </h2>
<div class="ui cards" > <div class="ui cards" >
<album-card :mode="'rich'" :album="album" :key="album.id" v-for="album in albums"></album-card> <album-card :mode="'rich'" :album="album" :key="album.id" v-for="album in albums"></album-card>
@ -50,16 +50,16 @@
</section> </section>
<section v-if="tracks.length > 0" class="ui vertical stripe segment"> <section v-if="tracks.length > 0" class="ui vertical stripe segment">
<h2> <h2>
<translate>Tracks by this artist</translate> <translate :translate-context="'Content/Artist/Title'">Tracks by this artist</translate>
</h2> </h2>
<track-table :display-position="true" :tracks="tracks"></track-table> <track-table :display-position="true" :tracks="tracks"></track-table>
</section> </section>
<section class="ui vertical stripe segment"> <section class="ui vertical stripe segment">
<h2> <h2>
<translate>User libraries</translate> <translate :translate-context="'Content/Artist/Title'">User libraries</translate>
</h2> </h2>
<library-widget :url="'artists/' + id + '/libraries/'"> <library-widget :url="'artists/' + id + '/libraries/'">
<translate slot="subtitle">This artist is present in the following libraries:</translate> <translate :translate-context="'Content/Artist/Paragraph'" slot="subtitle">This artist is present in the following libraries:</translate>
</library-widget> </library-widget>
</section> </section>
</template> </template>
@ -132,7 +132,7 @@ export default {
computed: { computed: {
labels() { labels() {
return { return {
title: this.$gettext("Artist") title: this.$pgettext('Head/Artist/Title', "Artist")
} }
}, },
isPlayable() { isPlayable() {

Wyświetl plik

@ -2,18 +2,18 @@
<main v-title="labels.title"> <main v-title="labels.title">
<section class="ui vertical stripe segment"> <section class="ui vertical stripe segment">
<h2 class="ui header"> <h2 class="ui header">
<translate>Browsing artists</translate> <translate :translate-context="'Content/Artist/Title'">Browsing artists</translate>
</h2> </h2>
<div :class="['ui', {'loading': isLoading}, 'form']"> <div :class="['ui', {'loading': isLoading}, 'form']">
<div class="fields"> <div class="fields">
<div class="field"> <div class="field">
<label> <label>
<translate>Search</translate> <translate :translate-context="'Content/Search/Input.Label/Verb'">Search</translate>
</label> </label>
<input type="text" name="search" v-model="query" :placeholder="labels.searchPlaceholder"/> <input type="text" name="search" v-model="query" :placeholder="labels.searchPlaceholder"/>
</div> </div>
<div class="field"> <div class="field">
<label><translate>Ordering</translate></label> <label><translate :translate-context="'Content/Search/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]] }}
@ -21,14 +21,14 @@
</select> </select>
</div> </div>
<div class="field"> <div class="field">
<label><translate>Ordering direction</translate></label> <label><translate :translate-context="'Content/Search/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/Search/Dropdown'">Ascending</translate></option>
<option value="-"><translate>Descending</translate></option> <option value="-"><translate :translate-context="'Content/Search/Dropdown'">Descending</translate></option>
</select> </select>
</div> </div>
<div class="field"> <div class="field">
<label><translate>Results per page</translate></label> <label><translate :translate-context="'Content/Search/Dropdown.Label'">Results per page</translate></label>
<select class="ui dropdown" v-model="paginateBy"> <select class="ui dropdown" v-model="paginateBy">
<option :value="parseInt(12)">12</option> <option :value="parseInt(12)">12</option>
<option :value="parseInt(25)">25</option> <option :value="parseInt(25)">25</option>
@ -113,8 +113,8 @@ export default {
}, },
computed: { computed: {
labels() { labels() {
let searchPlaceholder = this.$gettext("Enter artist name…") let searchPlaceholder = this.$pgettext('Content/Search/Input.Placeholder', "Enter artist name…")
let title = this.$gettext("Artists") let title = this.$pgettext('Head/Artist/Title', "Artists")
return { return {
searchPlaceholder, searchPlaceholder,
title title

Wyświetl plik

@ -1,9 +1,9 @@
<template> <template>
<div> <div>
<div class="ui top attached tabular menu"> <div class="ui top attached tabular menu">
<a :class="['item', {active: currentTab === 'summary'}]" @click="currentTab = 'summary'"><translate>Summary</translate></a> <a :class="['item', {active: currentTab === 'summary'}]" @click="currentTab = 'summary'"><translate :translate-context="'Content/Library/Tab.Title/Short'">Summary</translate></a>
<a :class="['item', {active: currentTab === 'uploads'}]" @click="currentTab = 'uploads'"> <a :class="['item', {active: currentTab === 'uploads'}]" @click="currentTab = 'uploads'">
<translate>Uploading</translate> <translate :translate-context="'Content/Library/Tab.Title/Short'">Uploading</translate>
<div v-if="files.length === 0" class="ui label"> <div v-if="files.length === 0" class="ui label">
0 0
</div> </div>
@ -15,7 +15,7 @@
</div> </div>
</a> </a>
<a :class="['item', {active: currentTab === 'processing'}]" @click="currentTab = 'processing'"> <a :class="['item', {active: currentTab === 'processing'}]" @click="currentTab = 'processing'">
<translate>Processing</translate> <translate :translate-context="'Content/Library/Tab.Title/Short'">Processing</translate>
<div v-if="processableFiles === 0" class="ui label"> <div v-if="processableFiles === 0" class="ui label">
0 0
</div> </div>
@ -29,19 +29,19 @@
</div> </div>
<div :class="['ui', 'bottom', 'attached', 'segment', {hidden: currentTab != 'summary'}]"> <div :class="['ui', 'bottom', 'attached', 'segment', {hidden: currentTab != 'summary'}]">
<h2 class="ui header"><translate>Upload new tracks</translate></h2> <h2 class="ui header"><translate :translate-context="'Content/Library/Title/Verb'">Upload new tracks</translate></h2>
<div class="ui message"> <div class="ui message">
<p><translate>You are about to upload music to your library. Before proceeding, please ensure that:</translate></p> <p><translate :translate-context="'Content/Library/Paragraph'">You are about to upload music to your library. Before proceeding, please ensure that:</translate></p>
<ul> <ul>
<li v-if="library.privacy_level != 'me'"> <li v-if="library.privacy_level != 'me'">
You are not uploading copyrighted content in a public library, otherwise you may be infringing the law <translate :translate-context="'Content/Library/List item'">You are not uploading copyrighted content in a public library, otherwise you may be infringing the law</translate>
</li> </li>
<li> <li>
<translate>The music files you are uploading are tagged properly:</translate> <translate :translate-context="'Content/Library/List item'">The music files you are uploading are tagged properly.</translate>&nbsp;
<a href="http://picard.musicbrainz.org/" target='_blank'><translate>We recommend using Picard for that purpose.</translate></a> <a href="http://picard.musicbrainz.org/" target='_blank'><translate :translate-context="'Content/Library/Link'">We recommend using Picard for that purpose.</translate></a>
</li> </li>
<li> <li>
<translate>The uploaded music files are in OGG, Flac or MP3 format</translate> <translate :translate-context="'Content/Library/List item'">The uploaded music files are in OGG, Flac or MP3 format</translate>
</li> </li>
</ul> </ul>
</div> </div>
@ -49,14 +49,14 @@
<div class="ui form"> <div class="ui form">
<div class="fields"> <div class="fields">
<div class="ui four wide field"> <div class="ui four wide field">
<label><translate>Import reference</translate></label> <label><translate :translate-context="'Content/Library/Input.Label/Noun'">Import reference</translate></label>
<p><translate>This reference will be used to group imported files together.</translate></p> <p><translate :translate-context="'Content/Library/Paragraph'">This reference will be used to group imported files together.</translate></p>
<input name="import-ref" type="text" v-model="importReference" /> <input name="import-ref" type="text" v-model="importReference" />
</div> </div>
</div> </div>
</div> </div>
<div class="ui green button" @click="currentTab = 'uploads'"><translate>Proceed</translate></div> <div class="ui green button" @click="currentTab = 'uploads'"><translate :translate-context="'Content/Library/Button.Label'">Proceed</translate></div>
</div> </div>
<div :class="['ui', 'bottom', 'attached', 'segment', {hidden: currentTab != 'uploads'}]"> <div :class="['ui', 'bottom', 'attached', 'segment', {hidden: currentTab != 'uploads'}]">
<div class="ui container"> <div class="ui container">
@ -73,18 +73,18 @@
@input-file="inputFile" @input-file="inputFile"
ref="upload"> ref="upload">
<i class="upload icon"></i>&nbsp; <i class="upload icon"></i>&nbsp;
<translate>Click to select files to upload or drag and drop files or directories</translate> <translate :translate-context="'Content/Library/Paragraph/Call to action'">Click to select files to upload or drag and drop files or directories</translate>
<br /> <br />
<br /> <br />
<i><translate :translate-params="{extensions: supportedExtensions.join(', ')}"> Supported extensions: %{ extensions }</translate></i> <i><translate :translate-context="'Content/Library/Paragraph'" :translate-params="{extensions: supportedExtensions.join(', ')}">Supported extensions: %{ extensions }</translate></i>
</file-upload-widget> </file-upload-widget>
</div> </div>
<table v-if="files.length > 0" class="ui single line table"> <table v-if="files.length > 0" class="ui single line table">
<thead> <thead>
<tr> <tr>
<th><translate>Filename</translate></th> <th><translate :translate-context="'Content/Library/Table.Label'">Filename</translate></th>
<th><translate>Size</translate></th> <th><translate :translate-context="'Content/Library/Table.Label'">Size</translate></th>
<th><translate>Status</translate></th> <th><translate :translate-context="'Content/Library/Table.Label'">Status</translate></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -98,14 +98,14 @@
</span> </span>
</span> </span>
<span v-else-if="file.success" class="ui green label"> <span v-else-if="file.success" class="ui green label">
<translate key="1">Uploaded</translate> <translate :translate-context="'Content/Library/Table'" key="1">Uploaded</translate>
</span> </span>
<span v-else-if="file.active" class="ui yellow label"> <span v-else-if="file.active" class="ui yellow label">
<translate key="2">Uploading</translate> <translate :translate-context="'Content/Library/Table'" key="2">Uploading</translate>
({{ parseInt(file.progress) }}%) ({{ parseInt(file.progress) }}%)
</span> </span>
<template v-else> <template v-else>
<span class="ui label"><translate key="3">Pending</translate></span> <span class="ui label"><translate :translate-context="'Content/Library/Table'" key="3">Pending</translate></span>
<button class="ui tiny basic red icon button" @click.prevent="$refs.upload.remove(file)"><i class="delete icon"></i></button> <button class="ui tiny basic red icon button" @click.prevent="$refs.upload.remove(file)"><i class="delete icon"></i></button>
</template> </template>
</td> </td>
@ -217,17 +217,17 @@ export default {
}, },
computed: { computed: {
labels() { labels() {
let denied = this.$gettext( let denied = this.$pgettext('Content/Library/Help text',
"Upload denied, ensure the file is not too big and that you have not reached your quota" "Upload denied, ensure the file is not too big and that you have not reached your quota"
); );
let server = this.$gettext( let server = this.$pgettext('Content/Library/Help text',
"Cannot upload this file, ensure it is not too big" "Cannot upload this file, ensure it is not too big"
); );
let network = this.$gettext( let network = this.$pgettext('Content/Library/Help text',
"A network error occured while uploading this file" "A network error occured while uploading this file"
); );
let timeout = this.$gettext("Upload timeout, please try again"); let timeout = this.$pgettext('Content/Library/Help text', "Upload timeout, please try again");
let extension = this.$gettext( let extension = this.$pgettext('Content/Library/Help text',
"Invalid file type, ensure you are uploading an audio file. Supported file extensions are %{ extensions }" "Invalid file type, ensure you are uploading an audio file. Supported file extensions are %{ extensions }"
); );
return { return {

Wyświetl plik

@ -4,17 +4,17 @@
<div class="ui stackable three column grid"> <div class="ui stackable three column grid">
<div class="column"> <div class="column">
<track-widget :url="'history/listenings/'" :filters="{scope: 'user', ordering: '-creation_date'}"> <track-widget :url="'history/listenings/'" :filters="{scope: 'user', ordering: '-creation_date'}">
<template slot="title"><translate>Recently listened</translate></template> <template slot="title"><translate :translate-context="'Content/Home/Title'">Recently listened</translate></template>
</track-widget> </track-widget>
</div> </div>
<div class="column"> <div class="column">
<track-widget :url="'favorites/tracks/'" :filters="{scope: 'user', ordering: '-creation_date'}"> <track-widget :url="'favorites/tracks/'" :filters="{scope: 'user', ordering: '-creation_date'}">
<template slot="title"><translate>Recently favorited</translate></template> <template slot="title"><translate :translate-context="'Content/Home/Title'">Recently favorited</translate></template>
</track-widget> </track-widget>
</div> </div>
<div class="column"> <div class="column">
<playlist-widget :url="'playlists/'" :filters="{scope: 'user', playable: true, ordering: '-creation_date'}"> <playlist-widget :url="'playlists/'" :filters="{scope: 'user', playable: true, ordering: '-creation_date'}">
<template slot="title"><translate>Playlists</translate></template> <template slot="title"><translate :translate-context="'Content/Home/Title'">Playlists</translate></template>
</playlist-widget> </playlist-widget>
</div> </div>
</div> </div>
@ -22,7 +22,7 @@
<div class="ui grid"> <div class="ui grid">
<div class="ui row"> <div class="ui row">
<album-widget :filters="{playable: true, ordering: '-creation_date'}"> <album-widget :filters="{playable: true, ordering: '-creation_date'}">
<template slot="title"><translate>Recently added</translate></template> <template slot="title"><translate :translate-context="'Content/Home/Title'">Recently added</translate></template>
</album-widget> </album-widget>
</div> </div>
</div> </div>
@ -62,7 +62,7 @@ export default {
computed: { computed: {
labels() { labels() {
return { return {
title: this.$gettext("Home") title: this.$pgettext('Head/Home/Title', "Home")
} }
} }
}, },

Wyświetl plik

@ -2,19 +2,19 @@
<div class="main library pusher"> <div class="main library pusher">
<nav class="ui secondary pointing menu" role="navigation" :aria-label="labels.secondaryMenu"> <nav class="ui secondary pointing menu" role="navigation" :aria-label="labels.secondaryMenu">
<router-link class="ui item" to="/library" exact> <router-link class="ui item" to="/library" exact>
<translate>Browse</translate> <translate :translate-context="'Menu/Home/Link/Verb'">Browse</translate>
</router-link> </router-link>
<router-link class="ui item" to="/library/albums" exact> <router-link class="ui item" to="/library/albums" exact>
<translate>Albums</translate> <translate :translate-context="'Menu/Home/Link'">Albums</translate>
</router-link> </router-link>
<router-link class="ui item" to="/library/artists" exact> <router-link class="ui item" to="/library/artists" exact>
<translate>Artists</translate> <translate :translate-context="'Menu/Home/Link'">Artists</translate>
</router-link> </router-link>
<router-link class="ui item" to="/library/radios" exact> <router-link class="ui item" to="/library/radios" exact>
<translate>Radios</translate> <translate :translate-context="'Menu/Home/Link'">Radios</translate>
</router-link> </router-link>
<router-link class="ui item" to="/library/playlists" exact> <router-link class="ui item" to="/library/playlists" exact>
<translate>Playlists</translate> <translate :translate-context="'Menu/Home/Link'">Playlists</translate>
</router-link> </router-link>
</nav> </nav>
<router-view :key="$route.fullPath"></router-view> <router-view :key="$route.fullPath"></router-view>
@ -32,7 +32,7 @@ export default {
}, },
labels() { labels() {
return { return {
secondaryMenu: this.$gettext("Secondary menu") secondaryMenu: this.$pgettext('Menu/*/Hidden text', "Secondary menu")
} }
} }
} }

Wyświetl plik

@ -2,12 +2,12 @@
<main v-title="labels.title"> <main v-title="labels.title">
<section class="ui vertical stripe segment"> <section class="ui vertical stripe segment">
<h2 class="ui header"> <h2 class="ui header">
<translate>Browsing radios</translate> <translate :translate-context="'Content/Radio/Title'">Browsing radios</translate>
</h2> </h2>
<div class="ui hidden divider"></div> <div class="ui hidden divider"></div>
<div class="ui row"> <div class="ui row">
<h3 class="ui header"> <h3 class="ui header">
<translate>Instance radios</translate> <translate :translate-context="'Content/Radio/Title'">Instance radios</translate>
</h3> </h3>
<div class="ui cards"> <div class="ui cards">
<radio-card :type="'favorites'"></radio-card> <radio-card :type="'favorites'"></radio-card>
@ -18,20 +18,20 @@
<div class="ui hidden divider"></div> <div class="ui hidden divider"></div>
<h3 class="ui header"> <h3 class="ui header">
<translate>User radios</translate> <translate :translate-context="'Content/Radio/Title'">User radios</translate>
</h3> </h3>
<router-link class="ui green basic button" to="/library/radios/build" exact> <router-link class="ui green basic button" to="/library/radios/build" exact>
<translate>Create your own radio</translate> <translate :translate-context="'Content/Radio/Button.Label/Verb'">Create your own radio</translate>
</router-link> </router-link>
<div class="ui hidden divider"></div> <div class="ui hidden divider"></div>
<div :class="['ui', {'loading': isLoading}, 'form']"> <div :class="['ui', {'loading': isLoading}, 'form']">
<div class="fields"> <div class="fields">
<div class="field"> <div class="field">
<label><translate>Search</translate></label> <label><translate :translate-context="'Content/Search/Input.Label/Verb'">Search</translate></label>
<input name="search" type="text" v-model="query" :placeholder="labels.searchPlaceholder"/> <input name="search" type="text" v-model="query" :placeholder="labels.searchPlaceholder"/>
</div> </div>
<div class="field"> <div class="field">
<label><translate>Ordering</translate></label> <label><translate :translate-context="'Content/Search/Dropdown.Label'">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]] }}
@ -39,18 +39,18 @@
</select> </select>
</div> </div>
<div class="field"> <div class="field">
<label><translate>Order</translate></label> <label><translate :translate-context="'Content/Search/Dropdown.Label'">Order</translate></label>
<select class="ui dropdown" v-model="orderingDirection"> <select class="ui dropdown" v-model="orderingDirection">
<option value="+"> <option value="+">
<translate>Ascending</translate> <translate :translate-context="'Content/Search/Dropdown'">Ascending</translate>
</option> </option>
<option value="-"> <option value="-">
<translate>Descending</translate> <translate :translate-context="'Content/Search/Dropdown'">Descending</translate>
</option> </option>
</select> </select>
</div> </div>
<div class="field"> <div class="field">
<label><translate>Results per page</translate></label> <label><translate :translate-context="'Content/Search/Dropdown.Label'">Results per page</translate></label>
<select class="ui dropdown" v-model="paginateBy"> <select class="ui dropdown" v-model="paginateBy">
<option :value="parseInt(12)">12</option> <option :value="parseInt(12)">12</option>
<option :value="parseInt(25)">25</option> <option :value="parseInt(25)">25</option>
@ -138,8 +138,8 @@ export default {
}, },
computed: { computed: {
labels() { labels() {
let searchPlaceholder = this.$gettext("Enter a radio name…") let searchPlaceholder = this.$pgettext('Content/Search/Input.Placeholder', "Enter a radio name…")
let title = this.$gettext("Radios") let title = this.$pgettext('Head/Radio/Title', "Radios")
return { return {
searchPlaceholder, searchPlaceholder,
title title

Wyświetl plik

@ -15,7 +15,7 @@
<div class="content"> <div class="content">
{{ track.title }} {{ track.title }}
<div class="sub header"> <div class="sub header">
<translate <translate :translate-context="'Content/Track/Paragraph'"
:translate-params="{album: track.album.title, artist: track.artist.name}" :translate-params="{album: track.album.title, artist: track.artist.name}"
>From album %{ album } by %{ artist }</translate> >From album %{ album } by %{ artist }</translate>
</div> </div>
@ -25,46 +25,46 @@
class="ui button" class="ui button"
:to="{name: 'library.albums.detail', params: {id: track.album.id }}" :to="{name: 'library.albums.detail', params: {id: track.album.id }}"
> >
<translate>Album page</translate> <translate :translate-context="'Content/Track/Button.Label'">Album page</translate>
</router-link> </router-link>
<router-link <router-link
class="ui button" class="ui button"
:to="{name: 'library.artists.detail', params: {id: track.artist.id }}" :to="{name: 'library.artists.detail', params: {id: track.artist.id }}"
> >
<translate>Artist page</translate> <translate :translate-context="'Content/Track/Button.Label'">Artist page</translate>
</router-link> </router-link>
</div> </div>
</div> </div>
</h2> </h2>
<play-button class="orange" :track="track"> <play-button class="orange" :track="track">
<translate>Play</translate> <translate :translate-context="'*/Queue/Button.Label/Short, Verb'">Play</translate>
</play-button> </play-button>
<track-favorite-icon :track="track" :button="true"></track-favorite-icon> <track-favorite-icon :track="track" :button="true"></track-favorite-icon>
<track-playlist-icon :button="true" v-if="$store.state.auth.authenticated" :track="track"></track-playlist-icon> <track-playlist-icon :button="true" v-if="$store.state.auth.authenticated" :track="track"></track-playlist-icon>
<a :href="wikipediaUrl" target="_blank" class="ui button"> <a :href="wikipediaUrl" target="_blank" class="ui button">
<i class="wikipedia w icon"></i> <i class="wikipedia w icon"></i>
<translate>Search on Wikipedia</translate> <translate :translate-context="'Content/*/Link/Verb'">Search on Wikipedia</translate>
</a> </a>
<a v-if="musicbrainzUrl" :href="musicbrainzUrl" target="_blank" class="ui button"> <a v-if="musicbrainzUrl" :href="musicbrainzUrl" target="_blank" class="ui button">
<i class="external icon"></i> <i class="external icon"></i>
<translate>View on MusicBrainz</translate> <translate :translate-context="'Content/*/Link/Verb'">View on MusicBrainz</translate>
</a> </a>
<a v-if="upload" :href="downloadUrl" target="_blank" class="ui button"> <a v-if="upload" :href="downloadUrl" target="_blank" class="ui button">
<i class="download icon"></i> <i class="download icon"></i>
<translate>Download</translate> <translate :translate-context="'Content/Track/Link/Verb'">Download</translate>
</a> </a>
<template v-if="publicLibraries.length > 0"> <template v-if="publicLibraries.length > 0">
<button <button
@click="showEmbedModal = !showEmbedModal" @click="showEmbedModal = !showEmbedModal"
class="ui button"> class="ui button">
<i class="code icon"></i> <i class="code icon"></i>
<translate>Embed</translate> <translate :translate-context="'Content/Track/Button.Label/Verb'">Embed</translate>
</button> </button>
<modal :show.sync="showEmbedModal"> <modal :show.sync="showEmbedModal">
<div class="header"> <div class="header">
<translate>Embed this track on your website</translate> <translate :translate-context="'Popup/Track/Title'">Embed this track on your website</translate>
</div> </div>
<div class="content"> <div class="content">
<div class="description"> <div class="description">
@ -74,7 +74,7 @@
</div> </div>
<div class="actions"> <div class="actions">
<div class="ui deny button"> <div class="ui deny button">
<translate>Cancel</translate> <translate :translate-context="'Popup/Track/Button/Verb'">Cancel</translate>
</div> </div>
</div> </div>
</modal> </modal>
@ -83,64 +83,64 @@
</section> </section>
<section class="ui vertical stripe center aligned segment"> <section class="ui vertical stripe center aligned segment">
<h2 class="ui header"> <h2 class="ui header">
<translate>Track information</translate> <translate :translate-context="'Content/Track/Title/Noun'">Track information</translate>
</h2> </h2>
<table class="ui very basic collapsing celled center aligned table"> <table class="ui very basic collapsing celled center aligned table">
<tbody> <tbody>
<tr> <tr>
<td> <td>
<translate>Copyright</translate> <translate :translate-context="'Content/Track/Table.Label/Noun'">Copyright</translate>
</td> </td>
<td v-if="track.copyright" :title="track.copyright">{{ track.copyright|truncate(50) }}</td> <td v-if="track.copyright" :title="track.copyright">{{ track.copyright|truncate(50) }}</td>
<td v-else> <td v-else>
<translate>We don't have any copyright information for this track</translate> <translate :translate-context="'Content/Track/Table.Paragraph'">No copyright information available for this track</translate>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<translate>License</translate> <translate :translate-context="'Content/Track/Table.Label/Noun'">License</translate>
</td> </td>
<td v-if="license"> <td v-if="license">
<a :href="license.url" target="_blank" rel="noopener noreferrer">{{ license.name }}</a> <a :href="license.url" target="_blank" rel="noopener noreferrer">{{ license.name }}</a>
</td> </td>
<td v-else> <td v-else>
<translate>We don't have any licensing information for this track</translate> <translate :translate-context="'Content/Track/Table.Paragraph'">No licensing information for this track</translate>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<translate>Duration</translate> <translate :translate-context="'Content/Track/Table.Label'">Duration</translate>
</td> </td>
<td v-if="upload && upload.duration">{{ time.parse(upload.duration) }}</td> <td v-if="upload && upload.duration">{{ time.parse(upload.duration) }}</td>
<td v-else> <td v-else>
<translate>N/A</translate> <translate :translate-context="'*/*/*'">N/A</translate>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<translate>Size</translate> <translate :translate-context="'Content/Track/Table.Label'">Size</translate>
</td> </td>
<td v-if="upload && upload.size">{{ upload.size | humanSize }}</td> <td v-if="upload && upload.size">{{ upload.size | humanSize }}</td>
<td v-else> <td v-else>
<translate>N/A</translate> <translate :translate-context="'*/*/*'">N/A</translate>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<translate>Bitrate</translate> <translate :translate-context="'Content/Track/Table.Label'">Bitrate</translate>
</td> </td>
<td v-if="upload && upload.bitrate">{{ upload.bitrate | humanSize }}/s</td> <td v-if="upload && upload.bitrate">{{ upload.bitrate | humanSize }}/s</td>
<td v-else> <td v-else>
<translate>N/A</translate> <translate :translate-context="'*/*/*'">N/A</translate>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<translate>Type</translate> <translate :translate-context="'Content/Track/Table.Label/Noun'">Type</translate>
</td> </td>
<td v-if="upload && upload.extension">{{ upload.extension }}</td> <td v-if="upload && upload.extension">{{ upload.extension }}</td>
<td v-else> <td v-else>
<translate>N/A</translate> <translate :translate-context="'*/*/*'">N/A</translate>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -148,7 +148,7 @@
</section> </section>
<section class="ui vertical stripe center aligned segment"> <section class="ui vertical stripe center aligned segment">
<h2> <h2>
<translate>Lyrics</translate> <translate :translate-context="'Content/Track/Title'">Lyrics</translate>
</h2> </h2>
<div v-if="isLoadingLyrics" class="ui vertical segment"> <div v-if="isLoadingLyrics" class="ui vertical segment">
<div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div> <div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div>
@ -156,20 +156,20 @@
<div v-if="lyrics" v-html="lyrics.content_rendered"></div> <div v-if="lyrics" v-html="lyrics.content_rendered"></div>
<template v-if="!isLoadingLyrics & !lyrics"> <template v-if="!isLoadingLyrics & !lyrics">
<p> <p>
<translate>No lyrics available for this track.</translate> <translate :translate-context="'Content/Track/Paragraph'">No lyrics available for this track.</translate>
</p> </p>
<a class="ui button" target="_blank" :href="lyricsSearchUrl"> <a class="ui button" target="_blank" :href="lyricsSearchUrl">
<i class="search icon"></i> <i class="search icon"></i>
<translate>Search on lyrics.wikia.com</translate> <translate :translate-context="'Content/Track/Link/Verb'">Search on lyrics.wikia.com</translate>
</a> </a>
</template> </template>
</section> </section>
<section class="ui vertical stripe segment"> <section class="ui vertical stripe segment">
<h2> <h2>
<translate>User libraries</translate> <translate :translate-context="'Content/Track/Title'">User libraries</translate>
</h2> </h2>
<library-widget @loaded="libraries = $event" :url="'tracks/' + id + '/libraries/'"> <library-widget @loaded="libraries = $event" :url="'tracks/' + id + '/libraries/'">
<translate slot="subtitle">This track is present in the following libraries:</translate> <translate :translate-context="'Content/Track/Paragraph'" slot="subtitle">This track is present in the following libraries:</translate>
</library-widget> </library-widget>
</section> </section>
</template> </template>
@ -259,7 +259,7 @@ export default {
}, },
labels() { labels() {
return { return {
title: this.$gettext("Track") title: this.$pgettext('Head/Track/Title', "Track")
} }
}, },
upload() { upload() {

Wyświetl plik

@ -3,52 +3,52 @@
<div> <div>
<section> <section>
<h2 class="ui header"> <h2 class="ui header">
<translate>Builder</translate> <translate :translate-context="'Content/Radio/Title'">Builder</translate>
</h2> </h2>
<p><translate>You can use this interface to build your own custom radio, which will play tracks according to your criteria.</translate></p> <p><translate :translate-context="'Content/Radio/Paragraph'">You can use this interface to build your own custom radio, which will play tracks according to your criteria.</translate></p>
<div class="ui form"> <div class="ui form">
<div v-if="success" class="ui positive message"> <div v-if="success" class="ui positive message">
<div class="header"> <div class="header">
<template v-if="radioName"> <template v-if="radioName">
<translate>Radio updated</translate> <translate :translate-context="'Content/Radio/Message'">Radio updated</translate>
</template> </template>
<template v-else> <template v-else>
<translate>Radio created</translate> <translate :translate-context="'Content/Radio/Message'">Radio created</translate>
</template> </template>
</div> </div>
</div> </div>
<div class=""> <div class="">
<div class="field"> <div class="field">
<label for="name"><translate>Radio name</translate></label> <label for="name"><translate :translate-context="'Content/Radio/Input.Label/Noun'">Radio name</translate></label>
<input id="name" name="name" type="text" v-model="radioName" :placeholder="labels.placeholder.name" /> <input id="name" name="name" type="text" v-model="radioName" :placeholder="labels.placeholder.name" />
</div> </div>
<div class="field"> <div class="field">
<label for="description"><translate>Description</translate></label> <label for="description"><translate :translate-context="'Content/Radio/Input.Label'">Description</translate></label>
<textarea rows="2" id="description" type="text" v-model="radioDesc" :placeholder="labels.placeholder.description" /> <textarea rows="2" id="description" type="text" v-model="radioDesc" :placeholder="labels.placeholder.description" />
</div> </div>
<div class="inline field"> <div class="inline field">
<input id="public" type="checkbox" v-model="isPublic" /> <input id="public" type="checkbox" v-model="isPublic" />
<label for="public"><translate>Display publicly</translate></label> <label for="public"><translate :translate-context="'Content/Radio/Checkbox.Label/Verb'">Display publicly</translate></label>
</div> </div>
<button :disabled="!canSave" @click="save" :class="['ui', 'green', {loading: isLoading}, 'button']"> <button :disabled="!canSave" @click="save" :class="['ui', 'green', {loading: isLoading}, 'button']">
<translate>Save</translate> <translate :translate-context="'Content/Radio/Button.Label/Verb'">Save</translate>
</button> </button>
<radio-button v-if="id" type="custom" :custom-radio-id="id"></radio-button> <radio-button v-if="id" type="custom" :custom-radio-id="id"></radio-button>
</div> </div>
</div> </div>
<div class="ui form"> <div class="ui form">
<p> <p>
<translate>Add filters to customize your radio</translate> <translate :translate-context="'Content/Radio/Paragraph'">Add filters to customize your radio</translate>
</p> </p>
<div class="inline field"> <div class="inline field">
<select class="ui dropdown" v-model="currentFilterType"> <select class="ui dropdown" v-model="currentFilterType">
<option value=""> <option value="">
<translate>Select a filter</translate> <translate :translate-context="'Content/Radio/Dropdown.Placeholder/Verb'">Select a filter</translate>
</option> </option>
<option v-for="f in availableFilters" :value="f.type">{{ f.label }}</option> <option v-for="f in availableFilters" :value="f.type">{{ f.label }}</option>
</select> </select>
<button :disabled="!currentFilterType" @click="add" class="ui button"> <button :disabled="!currentFilterType" @click="add" class="ui button">
<translate>Add filter</translate> <translate :translate-context="'Content/Radio/Button.Label/Verb'">Add filter</translate>
</button> </button>
</div> </div>
<p v-if="currentFilter"> <p v-if="currentFilter">
@ -58,11 +58,11 @@
<table class="ui table"> <table class="ui table">
<thead> <thead>
<tr> <tr>
<th class="two wide"><translate>Filter name</translate></th> <th class="two wide"><translate :translate-context="'Content/Radio/Table.Label/Noun'">Filter name</translate></th>
<th class="one wide"><translate>Exclude</translate></th> <th class="one wide"><translate :translate-context="'Content/Radio/Table.Label/Verb'">Exclude</translate></th>
<th class="six wide"><translate>Config</translate></th> <th class="six wide"><translate :translate-context="'Content/Radio/Table.Label/Verb (Value is a List of Parameters)'">Config</translate></th>
<th class="five wide"><translate>Candidates</translate></th> <th class="five wide"><translate :translate-context="'Content/Radio/Table.Label/Noun (Value is a number of Tracks)'">Candidates</translate></th>
<th class="two wide"><translate>Actions</translate></th> <th class="two wide"><translate :translate-context="'Content/Radio/Table.Label/Noun (Value is a Button)'">Actions</translate></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -230,10 +230,10 @@ export default {
}, },
computed: { computed: {
labels() { labels() {
let title = this.$gettext("Radio Builder") let title = this.$pgettext('Head/Radio/Title', "Radio Builder")
let placeholder = { let placeholder = {
name: this.$gettext("My awesome radio"), name: this.$pgettext('Content/Radio/Input.Placeholder', "My awesome radio"),
description: this.$gettext("My awesome description") description: this.$pgettext('Content/Radio/Input.Placeholder', "My awesome description")
} }
return { return {
title, title,

Wyświetl plik

@ -42,7 +42,7 @@
</span> </span>
<modal v-if="checkResult" :show.sync="showCandidadesModal"> <modal v-if="checkResult" :show.sync="showCandidadesModal">
<div class="header"> <div class="header">
<translate>Track matching filter</translate> <translate :translate-context="'Popup/Radio/Title/Noun'">Tracks matching filter</translate>
</div> </div>
<div class="content"> <div class="content">
<div class="description"> <div class="description">
@ -51,13 +51,13 @@
</div> </div>
<div class="actions"> <div class="actions">
<div class="ui black deny button"> <div class="ui black deny button">
<translate>Cancel</translate> <translate :translate-context="'Popup/Radio/Button.Label/Verb'">Cancel</translate>
</div> </div>
</div> </div>
</modal> </modal>
</td> </td>
<td> <td>
<button @click="$emit('delete', index)" class="ui basic red button"><translate>Remove</translate></button> <button @click="$emit('delete', index)" class="ui basic red button"><translate :translate-context="'Content/Radio/Button.Label/Verb'">Remove</translate></button>
</td> </td>
</tr> </tr>
</template> </template>