From 8ff6bc14874133d42b787a90ad16af497784d150 Mon Sep 17 00:00:00 2001 From: MBR#0001 Date: Sun, 23 Jul 2023 20:53:53 +0200 Subject: [PATCH 1/5] Add support for displaying more sub info --- .../subtitleeditor/subtitleeditor.js | 40 ++++++++++++++++--- src/strings/en-us.json | 6 ++- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/src/components/subtitleeditor/subtitleeditor.js b/src/components/subtitleeditor/subtitleeditor.js index 572cccc1fa..56d138de96 100644 --- a/src/components/subtitleeditor/subtitleeditor.js +++ b/src/components/subtitleeditor/subtitleeditor.js @@ -194,7 +194,8 @@ function renderSearchResults(context, results) { html += ''; - const bodyClass = result.Comment || result.IsHashMatch ? 'three-line' : 'two-line'; + const hasAnyFlags = result.IsHashMatch || result.AiTranslated || result.MachineTranslated || result.Forced || result.HearingImpaired; + const bodyClass = result.Comment || hasAnyFlags ? 'three-line' : 'two-line'; html += '
'; @@ -206,16 +207,45 @@ function renderSearchResults(context, results) { } if (result.DownloadCount != null) { - html += '' + globalize.translate('DownloadsValue', result.DownloadCount) + ''; + html += '' + globalize.translate('DownloadsValue', result.DownloadCount) + ''; } + + if (result.FrameRate) { + html += '' + globalize.translate('Framerate') + ': ' + result.FrameRate + ''; + } + html += '
'; if (result.Comment) { - html += '
' + escapeHtml(result.Comment) + '
'; + html += '
' + escapeHtml(result.Comment) + '
'; } - if (result.IsHashMatch) { - html += '
' + globalize.translate('PerfectMatch') + '
'; + if (hasAnyFlags) { + html += '
'; + + const spanOpen = ''; + + if (result.IsHashMatch) { + html += spanOpen + globalize.translate('PerfectMatch') + ''; + } + + if (result.AiTranslated) { + html += spanOpen + globalize.translate('AiTranslated') + ''; + } + + if (result.MachineTranslated) { + html += spanOpen + globalize.translate('MachineTranslated') + ''; + } + + if (result.Forced) { + html += spanOpen + globalize.translate('ForeignPartsOnly') + ''; + } + + if (result.HearingImpaired) { + html += spanOpen.replace('margin-right:0.25em;', '') + globalize.translate('HearingImpairedShort') + ''; + } + + html += '
'; } html += ''; diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 10639d58ef..56b02ef059 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -1715,5 +1715,9 @@ "Unreleased": "Not yet released", "LabelTonemappingMode": "Tone mapping mode", "TonemappingModeHelp": "Select the tone mapping mode. If you experience blown out highlights try switching to the RGB mode.", - "Unknown": "Unknown" + "Unknown": "Unknown", + "AiTranslated": "AI Translated", + "MachineTranslated": "Machine Translated", + "ForeignPartsOnly": "Forced/Foreign parts only", + "HearingImpairedShort": "HI/SDH" } From 29298cb823463a8116d66d3949feddbf5c1fb089 Mon Sep 17 00:00:00 2001 From: MBR#0001 Date: Tue, 12 Sep 2023 22:27:16 +0200 Subject: [PATCH 2/5] Move styles to class --- src/components/subtitleeditor/subtitleeditor.js | 2 +- src/components/subtitleeditor/subtitleeditor.scss | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/subtitleeditor/subtitleeditor.js b/src/components/subtitleeditor/subtitleeditor.js index 56d138de96..999fb217be 100644 --- a/src/components/subtitleeditor/subtitleeditor.js +++ b/src/components/subtitleeditor/subtitleeditor.js @@ -223,7 +223,7 @@ function renderSearchResults(context, results) { if (hasAnyFlags) { html += '
'; - const spanOpen = ''; + const spanOpen = ''; if (result.IsHashMatch) { html += spanOpen + globalize.translate('PerfectMatch') + ''; diff --git a/src/components/subtitleeditor/subtitleeditor.scss b/src/components/subtitleeditor/subtitleeditor.scss index 08e6faffba..d0d054cd09 100644 --- a/src/components/subtitleeditor/subtitleeditor.scss +++ b/src/components/subtitleeditor/subtitleeditor.scss @@ -1,3 +1,11 @@ .originalSubtitleFileLabel { margin-right: 1em; } + +.subtitleFeaturePillow { + background: #3388cc; + color: #fff; + padding: .3em 1em; + border-radius: 1000em; + margin-right: 0.25em; +} From 1f9cb0070fe3cc0df7aec8db9ed65c8c7035179b Mon Sep 17 00:00:00 2001 From: MBR-0001 <55142207+MBR-0001@users.noreply.github.com> Date: Tue, 12 Sep 2023 23:28:07 +0200 Subject: [PATCH 3/5] Update subtitleeditor.scss --- src/components/subtitleeditor/subtitleeditor.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/subtitleeditor/subtitleeditor.scss b/src/components/subtitleeditor/subtitleeditor.scss index d0d054cd09..16c2293cf1 100644 --- a/src/components/subtitleeditor/subtitleeditor.scss +++ b/src/components/subtitleeditor/subtitleeditor.scss @@ -3,9 +3,9 @@ } .subtitleFeaturePillow { - background: #3388cc; + background: #38c; color: #fff; - padding: .3em 1em; + padding: 0.3em 1em; border-radius: 1000em; margin-right: 0.25em; } From dca2594aaeb32eb7980845458b59d1a1601e3067 Mon Sep 17 00:00:00 2001 From: MBR-0001 <55142207+MBR-0001@users.noreply.github.com> Date: Thu, 14 Sep 2023 08:38:02 +0200 Subject: [PATCH 4/5] Update src/components/subtitleeditor/subtitleeditor.scss Co-authored-by: Bill Thornton --- src/components/subtitleeditor/subtitleeditor.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/subtitleeditor/subtitleeditor.scss b/src/components/subtitleeditor/subtitleeditor.scss index 16c2293cf1..578e82ddd2 100644 --- a/src/components/subtitleeditor/subtitleeditor.scss +++ b/src/components/subtitleeditor/subtitleeditor.scss @@ -3,8 +3,8 @@ } .subtitleFeaturePillow { - background: #38c; - color: #fff; + background: #00a4dc; + color: #000; padding: 0.3em 1em; border-radius: 1000em; margin-right: 0.25em; From c4cc6dbed1f40ca0ed4a639f80ec58e296efc111 Mon Sep 17 00:00:00 2001 From: MBR-0001 <55142207+MBR-0001@users.noreply.github.com> Date: Thu, 14 Sep 2023 08:38:14 +0200 Subject: [PATCH 5/5] Update src/components/subtitleeditor/subtitleeditor.js Co-authored-by: Bill Thornton --- src/components/subtitleeditor/subtitleeditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/subtitleeditor/subtitleeditor.js b/src/components/subtitleeditor/subtitleeditor.js index 999fb217be..ffe05ae5c3 100644 --- a/src/components/subtitleeditor/subtitleeditor.js +++ b/src/components/subtitleeditor/subtitleeditor.js @@ -242,7 +242,7 @@ function renderSearchResults(context, results) { } if (result.HearingImpaired) { - html += spanOpen.replace('margin-right:0.25em;', '') + globalize.translate('HearingImpairedShort') + ''; + html += spanOpen + globalize.translate('HearingImpairedShort') + ''; } html += '
';