From 32ccea92d272a132744d17481e5b06679d8c6aef Mon Sep 17 00:00:00 2001 From: Eliot Berriot <contact@eliotberriot.com> Date: Fri, 5 Oct 2018 19:53:28 +0200 Subject: [PATCH] See #559: Fixed untranslated privacy settings --- front/src/components/activity/Like.vue | 6 ++++-- front/src/components/activity/Listen.vue | 6 ++++-- front/src/components/auth/Settings.vue | 22 +++++++------------- front/src/components/mixins/Translations.vue | 10 +++++++++ 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/front/src/components/activity/Like.vue b/front/src/components/activity/Like.vue index 8e35598d..a0799e8f 100644 --- a/front/src/components/activity/Like.vue +++ b/front/src/components/activity/Like.vue @@ -9,8 +9,10 @@ <human-date class="date" :date="event.published" /> </div> <div class="extra text"> - <router-link :to="{name: 'library.tracks.detail', params: {id: event.object.local_id }}">{{ event.object.name }}</router-link> - <translate :translate-params="{album: event.object.album, artist: event.object.artist}">from %{ album } by %{ artist }</translate> + <router-link :to="{name: 'library.tracks.detail', params: {id: event.object.local_id }}"> + {{ event.object.name }} + </router-link> + <translate :translate-params="{album: event.object.album, artist: event.object.artist}">from %{ album } by %{ artist }</translate> </div> </div> </div> diff --git a/front/src/components/activity/Listen.vue b/front/src/components/activity/Listen.vue index 2d1a3c18..7790df58 100644 --- a/front/src/components/activity/Listen.vue +++ b/front/src/components/activity/Listen.vue @@ -9,8 +9,10 @@ <human-date class="date" :date="event.published" /> </div> <div class="extra text"> - <router-link :to="{name: 'library.tracks.detail', params: {id: event.object.local_id }}">{{ event.object.name }}</router-link> - <translate :translate-params="{album: event.object.album, artist: event.object.artist}">from %{ album } by %{ artist }</translate> + <router-link :to="{name: 'library.tracks.detail', params: {id: event.object.local_id }}"> + {{ event.object.name }} + </router-link> + <translate :translate-params="{album: event.object.album, artist: event.object.artist}">from %{ album } by %{ artist }</translate> </div> </div> </div> diff --git a/front/src/components/auth/Settings.vue b/front/src/components/auth/Settings.vue index 1e5a9ece..ec3b8f99 100644 --- a/front/src/components/auth/Settings.vue +++ b/front/src/components/auth/Settings.vue @@ -18,10 +18,10 @@ </ul> </div> <div class="field" v-for="f in orderedSettingsFields"> - <label :for="f.id">{{ f.label }}</label> - <p v-if="f.help">{{ f.help }}</p> + <label>{{ sharedLabels.fields[f.id].label }}</label> + <p v-if="f.help">{{ sharedLabels.fields[f.id].help }}</p> <select v-if="f.type === 'dropdown'" class="ui dropdown" v-model="f.value"> - <option :value="c.value" v-for="c in f.choices">{{ c.label }}</option> + <option :value="c" v-for="c in f.choices">{{ sharedLabels.fields[f.id].choices[c] }}</option> </select> </div> <button :class="['ui', {'loading': isLoading}, 'button']" type="submit"> @@ -118,8 +118,10 @@ import axios from 'axios' import logger from '@/logging' import PasswordInput from '@/components/forms/PasswordInput' import SubsonicTokenForm from '@/components/auth/SubsonicTokenForm' +import TranslationsMixin from '@/components/mixins/Translations' export default { + mixins: [TranslationsMixin], components: { PasswordInput, SubsonicTokenForm @@ -144,24 +146,14 @@ export default { 'privacy_level': { type: 'dropdown', initial: this.$store.state.auth.profile.privacy_level, - label: 'Activity visibility', - help: 'Determine the visibility level of your activity', - choices: [ - { - value: 'me', - label: 'Nobody except me' - }, - { - value: 'instance', - label: 'Everyone on this instance' - } - ] + choices: ['me', 'instance'] } } } } d.settings.order.forEach(id => { d.settings.fields[id].value = d.settings.fields[id].initial + d.settings.fields[id].id = id }) return d }, diff --git a/front/src/components/mixins/Translations.vue b/front/src/components/mixins/Translations.vue index 3372b04a..be35c2f3 100644 --- a/front/src/components/mixins/Translations.vue +++ b/front/src/components/mixins/Translations.vue @@ -3,6 +3,16 @@ export default { computed: { sharedLabels () { return { + fields: { + privacy_level: { + label: this.$gettext('Activity visibility'), + help: this.$gettext('Determine the visibility level of your activity'), + choices: { + me: this.$gettext('Nobody except me'), + instance: this.$gettext('Everyone on this instance'), + } + } + }, filters: { creation_date: this.$gettext('Creation date'), accessed_date: this.$gettext('Accessed date'), -- GitLab