diff --git a/src/renderer/components/ft-list-video/ft-list-video.js b/src/renderer/components/ft-list-video/ft-list-video.js index a707bdd0..f9c59e37 100644 --- a/src/renderer/components/ft-list-video/ft-list-video.js +++ b/src/renderer/components/ft-list-video/ft-list-video.js @@ -215,10 +215,14 @@ export default Vue.extend({ if (typeof (this.data.publishedText) !== 'undefined') { // produces a string according to the template in the locales string - this.toLocaleStringS({ + this.toLocalePublicationString({ publishText: this.data.publishedText, templateString: this.$t('Video.Publicationtemplate'), - timeStrings: this.$t('Video.Published') + timeStrings: this.$t('Video.Published'), + liveStreamString: this.$t('Video.Watching'), + upcomingString: this.$t('Video.Published.Upcoming'), + isLive: this.data.live, + isUpcoming: this.data.isUpcoming }).then((data) => { this.uploadedTime = data }).catch((error) => { @@ -262,6 +266,19 @@ export default Vue.extend({ } if (typeof (this.data.uploaded_at) !== 'undefined') { + this.toLocalePublicationString({ + publishText: this.data.uploaded_at, + templateString: this.$t('Video.Publicationtemplate'), + timeStrings: this.$t('Video.Published'), + liveStreamString: this.$t('Video.Watching'), + upcomingString: this.$t('Video.Published.Upcoming'), + isLive: this.data.live, + isUpcoming: false + }).then((data) => { + this.uploadedTime = data + }).catch((error) => { + console.error(error) + }) this.uploadedTime = this.data.uploaded_at } @@ -277,7 +294,7 @@ export default Vue.extend({ this.isLive = this.data.live }, ...mapActions([ - 'toLocaleStringS' + 'toLocalePublicationString' ]) } }) diff --git a/src/renderer/store/modules/utils.js b/src/renderer/store/modules/utils.js index b1776ee4..bef9726b 100644 --- a/src/renderer/store/modules/utils.js +++ b/src/renderer/store/modules/utils.js @@ -166,7 +166,13 @@ const actions = { return vttString }, - toLocaleStringS ({ dispatch }, payload) { + toLocalePublicationString ({ dispatch }, payload) { + if (payload.isLive) { + return '0' + payload.liveStreamString + } else if (payload.isUpcoming || payload.publishText === null) { + // the check for null is currently just an inferring of knowledge, because there is no other possibility left + return payload.upcomingString + } const strings = payload.publishText.split(' ') const singular = (strings[0] === '1') let publicationString = payload.templateString.replace('$', strings[0]) diff --git a/static/locales/de-DE.yaml b/static/locales/de-DE.yaml index 5f4c7fe5..50c917ad 100644 --- a/static/locales/de-DE.yaml +++ b/static/locales/de-DE.yaml @@ -318,6 +318,7 @@ Video: Year: Jahr Years: Jahren Ago: Vor + Upcoming: Premiere bald Published on: Veröffentlicht am Publicationtemplate: vor $ % veröffentlicht diff --git a/static/locales/en-US.yaml b/static/locales/en-US.yaml index 281f36b5..ad60dcc2 100644 --- a/static/locales/en-US.yaml +++ b/static/locales/en-US.yaml @@ -310,6 +310,7 @@ Video: Year: Year Years: Years Ago: Ago + Upcoming: Premieres soon Published on: Published on # $ is replaced with the number and % with the unit (days, hours, minutes...) Publicationtemplate: $ % ago diff --git a/static/locales/pt-PT.yaml b/static/locales/pt-PT.yaml index f25ad840..4f2cbc13 100644 --- a/static/locales/pt-PT.yaml +++ b/static/locales/pt-PT.yaml @@ -302,6 +302,10 @@ Video: Oct: Out Nov: Nov Dec: Dez + # ! + Second: Second + # ! + Seconds: Seconds Hour: Hora Hours: Horas Day: Dia @@ -313,7 +317,12 @@ Video: Year: Ano Years: Anos Ago: Há + # ! + Upcoming: Premieres soon Published on: Publicado em + # ! + # $ is replaced with the number and % with the unit (days, hours, minutes...) + Publicationtemplate: $ % ago #& Videos Videos: #& Sort By