From 39cec9a8a3358399bfd8e44eb3e55263531d8bf6 Mon Sep 17 00:00:00 2001 From: bluemoehre Date: Fri, 8 Nov 2024 18:48:35 +0100 Subject: [PATCH 1/2] allow dedicated translation of all video types --- src/components/upnextdialog/upnextdialog.js | 13 ++++++++++--- src/strings/en-us.json | 6 ++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/components/upnextdialog/upnextdialog.js b/src/components/upnextdialog/upnextdialog.js index 3f36e600203..f7d994494e6 100644 --- a/src/components/upnextdialog/upnextdialog.js +++ b/src/components/upnextdialog/upnextdialog.js @@ -55,9 +55,16 @@ function setNextVideoText() { const timeText = '' + globalize.translate('HeaderSecondsValue', secondsRemaining) + ''; - const nextVideoText = instance.showStaticNextText ? - globalize.translate('HeaderNextItem', globalize.translate(instance.itemType)) : - globalize.translate('HeaderNextItemPlayingInValue', globalize.translate(instance.itemType), timeText); + let nextVideoText; + if (instance.itemType === 'Episode') { + nextVideoText = instance.showStaticNextText + ? globalize.translate('HeaderNextEpisode') + : globalize.translate('HeaderNextEpisodePlayingInValue', timeText); + } else { + nextVideoText = instance.showStaticNextText + ? globalize.translate('HeaderNextVideo') + : globalize.translate('HeaderNextVideoPlayingInValue', timeText); + } elem.querySelector('.upNextDialog-nextVideoText').innerHTML = nextVideoText; } diff --git a/src/strings/en-us.json b/src/strings/en-us.json index e6a73a0d606..73948a3650f 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -461,8 +461,10 @@ "HeaderNewDevices": "New Devices", "HeaderNewPlaylist": "New Playlist", "HeaderNewRepository": "New Repository", - "HeaderNextItem": "Next {0}", - "HeaderNextItemPlayingInValue": "Next {0} Playing in {1}", + "HeaderNextEpisode": "Next Episode", + "HeaderNextEpisodePlayingInValue": "Next Episode Playing in {0}", + "HeaderNextVideo": "Next Video", + "HeaderNextVideoPlayingInValue": "Next Video Playing in {0}", "HeaderNoLyrics": "No lyrics found", "HeaderOnNow": "On Now", "HeaderOtherItems": "Other Items", From a50dd3062e07147801b1f5302d49bddef2fcbdbc Mon Sep 17 00:00:00 2001 From: bluemoehre Date: Fri, 8 Nov 2024 19:02:53 +0100 Subject: [PATCH 2/2] fix linter issue --- src/components/upnextdialog/upnextdialog.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/upnextdialog/upnextdialog.js b/src/components/upnextdialog/upnextdialog.js index f7d994494e6..74a0fc5ba78 100644 --- a/src/components/upnextdialog/upnextdialog.js +++ b/src/components/upnextdialog/upnextdialog.js @@ -57,13 +57,13 @@ function setNextVideoText() { let nextVideoText; if (instance.itemType === 'Episode') { - nextVideoText = instance.showStaticNextText - ? globalize.translate('HeaderNextEpisode') - : globalize.translate('HeaderNextEpisodePlayingInValue', timeText); + nextVideoText = instance.showStaticNextText ? + globalize.translate('HeaderNextEpisode') : + globalize.translate('HeaderNextEpisodePlayingInValue', timeText); } else { - nextVideoText = instance.showStaticNextText - ? globalize.translate('HeaderNextVideo') - : globalize.translate('HeaderNextVideoPlayingInValue', timeText); + nextVideoText = instance.showStaticNextText ? + globalize.translate('HeaderNextVideo') : + globalize.translate('HeaderNextVideoPlayingInValue', timeText); } elem.querySelector('.upNextDialog-nextVideoText').innerHTML = nextVideoText;