From 2b4b8ae6366c801f0ac4b7eaa663815824dcda03 Mon Sep 17 00:00:00 2001 From: xRangerDE Date: Mon, 11 May 2026 04:00:27 +0200 Subject: [PATCH] i18n: localize "Invalid time values" alert in clip-cutter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit confirmClipDialog (the handler behind the clip-cutter modals "Add to queue" button) opens an alert with a hardcoded English message when the parsed start / end / duration values come back as NaN — which can happen if the user types non-numeric characters or otherwise breaks the time-input pattern. German-locale users got an English alert on a German UI. Added clips.invalidTime to both locales ("Invalid time values" / "Ungueltige Zeitangaben") and swapped the inline string for the locale lookup. All the other alerts in that handler already go through UI_TEXT.clips.* — this was the one outlier. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/renderer-locale-de.ts | 1 + src/renderer-locale-en.ts | 1 + src/renderer.ts | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/renderer-locale-de.ts b/src/renderer-locale-de.ts index b136ebe..8287197 100644 --- a/src/renderer-locale-de.ts +++ b/src/renderer-locale-de.ts @@ -413,6 +413,7 @@ const UI_TEXT_DE = { dialogFormatLabel: 'Dateinamen-Format:', dialogConfirm: 'Zur Queue hinzufuegen', invalidDuration: 'Ungultig!', + invalidTime: 'Ungueltige Zeitangaben', endBeforeStart: 'Endzeit muss grosser als Startzeit sein!', outOfRange: 'Zeit ausserhalb des VOD-Bereichs!', enterUrl: 'Bitte URL eingeben', diff --git a/src/renderer-locale-en.ts b/src/renderer-locale-en.ts index 12618fd..8c7a2a7 100644 --- a/src/renderer-locale-en.ts +++ b/src/renderer-locale-en.ts @@ -413,6 +413,7 @@ const UI_TEXT_EN = { dialogFormatLabel: 'Filename format:', dialogConfirm: 'Add to queue', invalidDuration: 'Invalid!', + invalidTime: 'Invalid time values', endBeforeStart: 'End time must be greater than start time!', outOfRange: 'Time is outside VOD range!', enterUrl: 'Please enter a URL', diff --git a/src/renderer.ts b/src/renderer.ts index 3fea8fe..d6ffe5b 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -1309,7 +1309,7 @@ async function confirmClipDialog(): Promise { const filenameTemplate = byId('clipFilenameTemplate').value.trim(); if (isNaN(startSec) || isNaN(endSec) || isNaN(durationSec)) { - alert('Invalid time values'); + alert(UI_TEXT.clips.invalidTime); return; }