From 898e5139748fa3f22a035abcf493d2ad1eaf4c0c Mon Sep 17 00:00:00 2001 From: Preston Date: Thu, 6 Aug 2020 20:20:42 -0400 Subject: [PATCH] Make some progress on incorporating the locale file into the app --- .../ft-search-filters/ft-search-filters.js | 66 +++++++++-------- .../ft-search-filters/ft-search-filters.vue | 10 +-- .../ft-share-button/ft-share-button.vue | 18 ++--- .../general-settings/general-settings.js | 38 ++++++---- .../general-settings/general-settings.vue | 20 +++--- .../player-settings/player-settings.js | 41 ++++++----- .../player-settings/player-settings.vue | 22 +++--- src/renderer/components/side-nav/side-nav.vue | 14 ++-- .../theme-settings/theme-settings.js | 53 +++++++------- .../theme-settings/theme-settings.vue | 10 +-- src/renderer/components/top-nav/top-nav.vue | 2 +- .../watch-video-info/watch-video-info.js | 20 +++--- .../watch-video-info/watch-video-info.vue | 6 +- .../watch-video-recommendations.vue | 2 +- src/renderer/views/History/History.vue | 4 +- src/renderer/views/Popular/Popular.vue | 2 +- .../views/Subscriptions/Subscriptions.vue | 2 +- src/renderer/views/Trending/Trending.vue | 2 +- .../views/UserPlaylists/UserPlaylists.vue | 4 +- src/renderer/views/Watch/Watch.js | 2 +- static/locales/en-US.yaml | 70 ++++++++++--------- 21 files changed, 221 insertions(+), 187 deletions(-) diff --git a/src/renderer/components/ft-search-filters/ft-search-filters.js b/src/renderer/components/ft-search-filters/ft-search-filters.js index 56b55fea..49a66d3b 100644 --- a/src/renderer/components/ft-search-filters/ft-search-filters.js +++ b/src/renderer/components/ft-search-filters/ft-search-filters.js @@ -10,28 +10,12 @@ export default Vue.extend({ }, data: function () { return { - sortByTitle: 'Sort By', - sortByLabels: [ - 'Most Relevant', - 'Rating', - 'Upload Date', - 'View Count' - ], sortByValues: [ 'relevance', 'rating', 'upload_date', 'view_count' ], - timeTitle: 'Time', - timeLabels: [ - 'Any Time', - 'Last Hour', - 'Today', - 'This Week', - 'This Month', - 'This Year' - ], timeValues: [ '', 'hour', @@ -40,25 +24,12 @@ export default Vue.extend({ 'month', 'year' ], - typeTitle: 'Type', - typeLabels: [ - 'All Types', - 'Videos', - 'Channels', - 'Playlists' - ], typeValues: [ 'all', 'video', 'channel', 'playlist' ], - durationTitle: 'Duration', - durationLabels: [ - 'All Durations', - 'Short (< 4 minutes)', - 'Long (> 20 minutes)' - ], durationValues: [ '', 'short', @@ -69,6 +40,43 @@ export default Vue.extend({ computed: { searchSettings: function () { return this.$store.getters.getSearchSettings + }, + + sortByLabels: function () { + return [ + this.$t('Search Filters.Sort By.Most Relevant'), + this.$t('Search Filters.Sort By.Rating'), + this.$t('Search Filters.Sort By.Upload Date'), + this.$t('Search Filters.Sort By.View Count') + ] + }, + + timeLabels: function () { + return [ + this.$t('Search Filters.Time.Any Time'), + this.$t('Search Filters.Time.Last Hour'), + this.$t('Search Filters.Time.Today'), + this.$t('Search Filters.Time.This Week'), + this.$t('Search Filters.Time.This Month'), + this.$t('Search Filters.Time.This Year') + ] + }, + + typeLabels: function () { + return [ + this.$t('Search Filters.Type.All Types'), + this.$t('Search Filters.Type.Videos'), + this.$t('Search Filters.Type.Channels'), + this.$t('Playlists') + ] + }, + + durationLabels: function () { + return [ + this.$t('Search Filters.Duration.All Durations'), + this.$t('Search Filters.Duration.Short (< 4 minutes)'), + this.$t('Search Filters.Duration.Long (> 20 minutes)') + ] } }, methods: { diff --git a/src/renderer/components/ft-search-filters/ft-search-filters.vue b/src/renderer/components/ft-search-filters/ft-search-filters.vue index e641548b..8b35d107 100644 --- a/src/renderer/components/ft-search-filters/ft-search-filters.vue +++ b/src/renderer/components/ft-search-filters/ft-search-filters.vue @@ -1,32 +1,32 @@