#662: Resolve "Add contexts to translatable strings"

merge-requests/622/head
jovuit 2019-02-13 08:14:14 +01:00 zatwierdzone przez Eliot Berriot
rodzic 8830440b15
commit 29e8b23a16
3 zmienionych plików z 12 dodań i 13 usunięć

Wyświetl plik

@ -435,7 +435,6 @@ This hierarchical structure is made of several parts:
- ``Popup`` - ``Popup``
- ``Sidebar`` - ``Sidebar``
- ``Head`` - ``Head``
- ``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:

Wyświetl plik

@ -3,10 +3,10 @@
<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 <router-link
class="ui item" class="ui item"
:to="{name: 'content.libraries.index'}"><translate>Libraries</translate></router-link> :to="{name: 'content.libraries.index'}"><translate :translate-context="'Menu/Library/Tab.Link'">Libraries</translate></router-link>
<router-link <router-link
class="ui item" class="ui item"
:to="{name: 'content.libraries.files'}"><translate>Tracks</translate></router-link> :to="{name: 'content.libraries.files'}"><translate :translate-context="'Menu/Library/Tab.Link'">Tracks</translate></router-link>
</nav> </nav>
<router-view :key="$route.fullPath"></router-view> <router-view :key="$route.fullPath"></router-view>
</main> </main>
@ -15,7 +15,7 @@
export default { export default {
computed: { computed: {
labels() { labels() {
let title = this.$gettext("Add content") let title = this.$pgettext('Head/Library/Title', "Add content")
let secondaryMenu = this.$pgettext('Menu/*/Hidden text', "Secondary menu") let secondaryMenu = this.$pgettext('Menu/*/Hidden text', "Secondary menu")
return { return {
title, title,

Wyświetl plik

@ -2,22 +2,22 @@
<section class="ui vertical aligned stripe segment" v-title="labels.title"> <section class="ui vertical aligned stripe segment" v-title="labels.title">
<div class="ui text container"> <div class="ui text container">
<h1>{{ labels.title }}</h1> <h1>{{ labels.title }}</h1>
<p><translate>There are various ways to grab new content and make it available here.</translate></p> <p><translate :translate-context="'Content/Library/Paragraph'">There are various ways to grab new content and make it available here.</translate></p>
<div class="ui segment"> <div class="ui segment">
<h2><translate>Upload audio content</translate></h2> <h2><translate :translate-context="'Content/Library/Title/Verb'">Upload audio content</translate></h2>
<p><translate>Upload music files (MP3, OGG, FLAC, etc.) from your personal library directly from your browser to enjoy them here.</translate></p> <p><translate :translate-context="'Content/Library/Paragraph'">Upload music files (MP3, OGG, FLAC, etc.) from your personal library directly from your browser to enjoy them here.</translate></p>
<p> <p>
<strong><translate :translate-params="{quota: defaultQuota}">This instance offers up to %{quota} of storage space for every user.</translate></strong> <strong><translate :translate-context="'Content/Library/Paragraph'" :translate-params="{quota: defaultQuota}">This instance offers up to %{quota} of storage space for every user.</translate></strong>
</p> </p>
<router-link :to="{name: 'content.libraries.index'}" class="ui green button"> <router-link :to="{name: 'content.libraries.index'}" class="ui green button">
<translate>Get started</translate> <translate :translate-context="'Content/Library/Button.Label/Verb'">Get started</translate>
</router-link> </router-link>
</div> </div>
<div class="ui segment"> <div class="ui segment">
<h2><translate>Follow remote libraries</translate></h2> <h2><translate :translate-context="'Content/Library/Title/Verb'">Follow remote libraries</translate></h2>
<p><translate>You can follow libraries from other users to get access to new music. Public libraries can be followed immediatly, while following a private library requires approval from its owner.</translate></p> <p><translate :translate-context="'Content/Library/Paragraph'">You can follow libraries from other users to get access to new music. Public libraries can be followed immediatly, while following a private library requires approval from its owner.</translate></p>
<router-link :to="{name: 'content.remote.index'}" class="ui green button"> <router-link :to="{name: 'content.remote.index'}" class="ui green button">
<translate>Get started</translate> <translate :translate-context="'Content/Library/Button.Label/Verb'">Get started</translate>
</router-link> </router-link>
</div> </div>
@ -32,7 +32,7 @@ export default {
computed: { computed: {
labels() { labels() {
return { return {
title: this.$gettext("Add and manage content") title: this.$pgettext('Content/Library/Title/Verb', "Add and manage content")
} }
}, },
defaultQuota() { defaultQuota() {