From 95c43c2ff689c8f0bde44d73701da38d50cf7c6f Mon Sep 17 00:00:00 2001
From: jovuit <jo.vuitton@gmail.com>
Date: Fri, 8 Feb 2019 10:06:28 +0100
Subject: [PATCH] Resolve "Add contexts to translatable strings"

---
 CONTRIBUTING.rst                        |  2 ++
 front/src/components/favorites/List.vue | 17 +++++++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 085975a5..e43adc07 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -434,6 +434,7 @@ This hierarchical structure is made of several parts:
     - ``Menu``
     - ``Modal``
     - ``Sidebar``
+    - ``Head``
     - ``Popup``
     - ``*`` for strings that are not tied to a specific location
 
@@ -447,6 +448,7 @@ This hierarchical structure is made of several parts:
     - ``Moderation``
     - ``Player``
     - ``Playlist``
+    - ``Favorites``
     - ``Notifications``
     - ``Radio``
     - ``Settings``
diff --git a/front/src/components/favorites/List.vue b/front/src/components/favorites/List.vue
index 8015b967..bf971fab 100644
--- a/front/src/components/favorites/List.vue
+++ b/front/src/components/favorites/List.vue
@@ -3,7 +3,7 @@
     <section class="ui vertical center aligned stripe segment">
       <div :class="['ui', {'active': isLoading}, 'inverted', 'dimmer']">
         <div class="ui text loader">
-          <translate>Loading your favorites…</translate>
+          <translate :translate-context="'Content/Favorites/Message'">Loading your favorites…</translate>
         </div>
       </div>
       <h2 v-if="results" class="ui center aligned icon header">
@@ -11,7 +11,8 @@
         <translate
           translate-plural="%{ count } favorites"
           :translate-n="$store.state.favorites.count"
-          :translate-params="{count: results.count}">
+          :translate-params="{count: results.count}"
+					:translate-context="'Content/Favorites/Title'">
           1 favorite
         </translate>
       </h2>
@@ -21,7 +22,7 @@
       <div :class="['ui', {'loading': isLoading}, 'form']">
         <div class="fields">
           <div class="field">
-            <label><translate>Ordering</translate></label>
+            <label><translate :translate-context="'Content/Favorites/Dropdown.Title/Short, Name'">Ordering</translate></label>
             <select class="ui dropdown" v-model="ordering">
               <option v-for="option in orderingOptions" :value="option[0]">
                 {{ sharedLabels.filters[option[1]] }}
@@ -29,14 +30,14 @@
             </select>
           </div>
           <div class="field">
-            <label><translate>Order</translate></label>
+            <label><translate :translate-context="'Content/*/Dropdown.Label/Short, Name'">Order</translate></label>
             <select class="ui dropdown" v-model="orderingDirection">
-              <option value="+"><translate>Ascending</translate></option>
-              <option value="-"><translate>Descending</translate></option>
+              <option value="+"><translate :translate-context="'Content/*/Dropdown/Short'">Ascending</translate></option>
+              <option value="-"><translate :translate-context="'Content/*/Short'">Descending</translate></option>
             </select>
           </div>
           <div class="field">
-            <label><translate>Results per page</translate></label>
+            <label><translate :translate-context="'Content/*/Dropdown.Label/Short, Name'">Results per page</translate></label>
             <select class="ui dropdown" v-model="paginateBy">
               <option :value="parseInt(12)">12</option>
               <option :value="parseInt(25)">25</option>
@@ -112,7 +113,7 @@ export default {
   computed: {
     labels() {
       return {
-        title: this.$gettext("Your Favorites")
+        title: this.$pgettext('Head/Favorites/Title', 'Your Favorites')
       }
     }
   },
-- 
GitLab