i18n: localize "Invalid time values" alert in clip-cutter
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) <noreply@anthropic.com>
This commit is contained in:
parent
8ef2ce50e7
commit
2b4b8ae636
@ -413,6 +413,7 @@ const UI_TEXT_DE = {
|
|||||||
dialogFormatLabel: 'Dateinamen-Format:',
|
dialogFormatLabel: 'Dateinamen-Format:',
|
||||||
dialogConfirm: 'Zur Queue hinzufuegen',
|
dialogConfirm: 'Zur Queue hinzufuegen',
|
||||||
invalidDuration: 'Ungultig!',
|
invalidDuration: 'Ungultig!',
|
||||||
|
invalidTime: 'Ungueltige Zeitangaben',
|
||||||
endBeforeStart: 'Endzeit muss grosser als Startzeit sein!',
|
endBeforeStart: 'Endzeit muss grosser als Startzeit sein!',
|
||||||
outOfRange: 'Zeit ausserhalb des VOD-Bereichs!',
|
outOfRange: 'Zeit ausserhalb des VOD-Bereichs!',
|
||||||
enterUrl: 'Bitte URL eingeben',
|
enterUrl: 'Bitte URL eingeben',
|
||||||
|
|||||||
@ -413,6 +413,7 @@ const UI_TEXT_EN = {
|
|||||||
dialogFormatLabel: 'Filename format:',
|
dialogFormatLabel: 'Filename format:',
|
||||||
dialogConfirm: 'Add to queue',
|
dialogConfirm: 'Add to queue',
|
||||||
invalidDuration: 'Invalid!',
|
invalidDuration: 'Invalid!',
|
||||||
|
invalidTime: 'Invalid time values',
|
||||||
endBeforeStart: 'End time must be greater than start time!',
|
endBeforeStart: 'End time must be greater than start time!',
|
||||||
outOfRange: 'Time is outside VOD range!',
|
outOfRange: 'Time is outside VOD range!',
|
||||||
enterUrl: 'Please enter a URL',
|
enterUrl: 'Please enter a URL',
|
||||||
|
|||||||
@ -1309,7 +1309,7 @@ async function confirmClipDialog(): Promise<void> {
|
|||||||
const filenameTemplate = byId<HTMLInputElement>('clipFilenameTemplate').value.trim();
|
const filenameTemplate = byId<HTMLInputElement>('clipFilenameTemplate').value.trim();
|
||||||
|
|
||||||
if (isNaN(startSec) || isNaN(endSec) || isNaN(durationSec)) {
|
if (isNaN(startSec) || isNaN(endSec) || isNaN(durationSec)) {
|
||||||
alert('Invalid time values');
|
alert(UI_TEXT.clips.invalidTime);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user