Merge branch '662-artist' into 'develop'

Resolve "Add contexts to translatable strings to Album page"

See merge request funkwhale/funkwhale!588
This commit is contained in:
Eliot Berriot 2019-02-08 09:57:52 +01:00
commit d92f790ef6
2 changed files with 15 additions and 13 deletions

View File

@ -434,6 +434,7 @@ This hierarchical structure is made of several parts:
- ``Menu`` - ``Menu``
- ``Modal`` - ``Modal``
- ``Sidebar`` - ``Sidebar``
- ``Popup``
- ``*`` for strings that are not tied to a specific location - ``*`` for strings that are not tied to a specific location
- The feature part, which is required, and refers to the feature associated with the translated string: - The feature part, which is required, and refers to the feature associated with the translated string:

View File

@ -14,33 +14,33 @@
</div> </div>
<div class="ui buttons"> <div class="ui buttons">
<router-link class="ui button" :to="{name: 'library.artists.detail', params: {id: album.artist.id }}"> <router-link class="ui button" :to="{name: 'library.artists.detail', params: {id: album.artist.id }}">
<translate>Artist page</translate> <translate :translate-context="'Content/*/Button.Label/Name'">Artist page</translate>
</router-link> </router-link>
</div> </div>
</h2> </h2>
<div class="ui hidden divider"></div> <div class="ui hidden divider"></div>
<play-button class="orange" :tracks="album.tracks"> <play-button class="orange" :tracks="album.tracks">
<translate>Play all</translate> <translate :translate-context="'Content/*/Button.Label/Verb, Short'">Play all</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>
<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/*/Button.Label/Verb'">Embed</translate>
</button> </button>
<modal :show.sync="showEmbedModal"> <modal :show.sync="showEmbedModal">
<div class="header"> <div class="header">
<translate>Embed this album on your website</translate> <translate :translate-context="'Popup/Album/Title/Verb'">Embed this album on your website</translate>
</div> </div>
<div class="content"> <div class="content">
<div class="description"> <div class="description">
@ -50,7 +50,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/*/Button.Label/Verb'">Cancel</translate>
</div> </div>
</div> </div>
</modal> </modal>
@ -63,9 +63,10 @@
tag="h2" tag="h2"
class="left floated" class="left floated"
:translate-params="{number: disc_number + 1}" :translate-params="{number: disc_number + 1}"
:translate-context="'Content/Album/'"
>Volume %{ number }</translate> >Volume %{ number }</translate>
<play-button class="right floated orange" :tracks="tracks"> <play-button class="right floated orange" :tracks="tracks">
<translate>Play all</translate> <translate :translate-context="'Content/*/Button.Label/Verb, Short'">Play all</translate>
</play-button> </play-button>
<track-table :artist="album.artist" :display-position="true" :tracks="tracks"></track-table> <track-table :artist="album.artist" :display-position="true" :tracks="tracks"></track-table>
</section> </section>
@ -73,17 +74,17 @@
<template v-else> <template v-else>
<section class="ui vertical stripe segment"> <section class="ui vertical stripe segment">
<h2> <h2>
<translate>Tracks</translate> <translate :translate-context="'Content/*/Title/Name'">Tracks</translate>
</h2> </h2>
<track-table v-if="album" :artist="album.artist" :display-position="true" :tracks="album.tracks"></track-table> <track-table v-if="album" :artist="album.artist" :display-position="true" :tracks="album.tracks"></track-table>
</section> </section>
</template> </template>
<section class="ui vertical stripe segment"> <section class="ui vertical stripe segment">
<h2> <h2>
<translate>User libraries</translate> <translate :translate-context="'Content/*/Title/Name'">User libraries</translate>
</h2> </h2>
<library-widget @loaded="libraries = $event" :url="'albums/' + id + '/libraries/'"> <library-widget @loaded="libraries = $event" :url="'albums/' + id + '/libraries/'">
<translate slot="subtitle">This album is present in the following libraries:</translate> <translate slot="subtitle" :translate-context="'Content/Album/Paragraph'">This album is present in the following libraries:</translate>
</library-widget> </library-widget>
</section> </section>
</template> </template>
@ -150,7 +151,7 @@ export default {
computed: { computed: {
labels() { labels() {
return { return {
title: this.$gettext("Album") title: this.$pgettext('Head/Album/Title/Name', 'Album')
} }
}, },
publicLibraries () { publicLibraries () {
@ -180,7 +181,7 @@ export default {
) )
}, },
subtitle () { subtitle () {
let msg = this.$ngettext('Album containing %{ count } track, by %{ artist }', 'Album containing %{ count } tracks, by %{ artist }', this.album.tracks.length) let msg = this.$npgettext('Content/Album/Header.Title', 'Album containing %{ count } track, by %{ artist }', 'Album containing %{ count } tracks, by %{ artist }', this.album.tracks.length)
return this.$gettextInterpolate(msg, {count: this.album.tracks.length, artist: this.album.artist.name}) return this.$gettextInterpolate(msg, {count: this.album.tracks.length, artist: this.album.artist.name})
} }
}, },