Math.max(0, Math.round(videoDuration * 1000)), [videoDuration]);
const currentTimeMs = useMemo(() => Math.round(currentTime * 1000), [currentTime]);
const timelineScale = useMemo(() => calculateTimelineScale(videoDuration), [videoDuration]);
@@ -635,7 +637,7 @@ export default function TimelineEditor({
}
return false;
- }, [zoomRegions, trimRegions, annotationRegions]);
+ }, [zoomRegions, trimRegions, annotationRegions, t]);
const handleAddZoom = useCallback(() => {
if (!videoDuration || videoDuration === 0 || totalMs === 0) {
@@ -657,15 +659,15 @@ export default function TimelineEditor({
// Check if playhead is inside any zoom region
const isOverlapping = sorted.some(region => startPos >= region.startMs && startPos < region.endMs);
if (isOverlapping || gapToNext <= 0) {
- toast.error("Cannot place zoom here", {
- description: "Zoom already exists at this location or not enough space available.",
+ toast.error(t("Cannot place zoom here"), {
+ description: t("Zoom already exists at this location or not enough space available."),
});
return;
}
const actualDuration = Math.min(1000, gapToNext);
onZoomAdded({ start: startPos, end: startPos + actualDuration });
- }, [videoDuration, totalMs, currentTimeMs, zoomRegions, onZoomAdded]);
+ }, [videoDuration, totalMs, currentTimeMs, zoomRegions, onZoomAdded, t]);
const handleAddTrim = useCallback(() => {
if (!videoDuration || videoDuration === 0 || totalMs === 0 || !onTrimAdded) {
@@ -687,15 +689,15 @@ export default function TimelineEditor({
// Check if playhead is inside any trim region
const isOverlapping = sorted.some(region => startPos >= region.startMs && startPos < region.endMs);
if (isOverlapping || gapToNext <= 0) {
- toast.error("Cannot place trim here", {
- description: "Trim already exists at this location or not enough space available.",
+ toast.error(t("Cannot place trim here"), {
+ description: t("Trim already exists at this location or not enough space available."),
});
return;
}
const actualDuration = Math.min(1000, gapToNext);
onTrimAdded({ start: startPos, end: startPos + actualDuration });
- }, [videoDuration, totalMs, currentTimeMs, trimRegions, onTrimAdded]);
+ }, [videoDuration, totalMs, currentTimeMs, trimRegions, onTrimAdded, t]);
const handleAddAnnotation = useCallback(() => {
if (!videoDuration || videoDuration === 0 || totalMs === 0 || !onAnnotationAdded) {
@@ -805,12 +807,12 @@ export default function TimelineEditor({
if (region.type === 'text') {
// Show text preview
- const preview = region.content.trim() || 'Empty text';
+ const preview = region.content.trim() || t('Empty text');
label = preview.length > 20 ? `${preview.substring(0, 20)}...` : preview;
} else if (region.type === 'image') {
- label = 'Image';
+ label = t('Image');
} else {
- label = 'Annotation';
+ label = t('Annotation');
}
return {
@@ -843,8 +845,8 @@ export default function TimelineEditor({