From 7eb452ed8bf4e79c032120f4c8611a64554ee971 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 10 Mar 2026 20:22:03 +0200 Subject: [PATCH] refactor(video_player): use translations --- .../src/translations/en/translation.json | 16 ++++++++++++++++ .../src/widgets/type_widgets/file/Video.tsx | 19 ++++++++++--------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index 2e228a9825..cbaf7a3767 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -1036,6 +1036,22 @@ "file_preview_not_available": "File preview is not available for this file format.", "too_big": "The preview only shows the first {{maxNumChars}} characters of the file for performance reasons. Download the file and open it externally to be able to see the entire content." }, + "video": { + "play": "Play", + "pause": "Pause", + "back-10s": "Back 10s", + "forward-30s": "Forward 30s", + "mute": "Mute", + "unmute": "Unmute", + "playback-speed": "Playback speed", + "loop": "Loop", + "disable-loop": "Disable loop", + "rotate": "Rotate", + "picture-in-picture": "Picture-in-picture", + "exit-picture-in-picture": "Exit picture-in-picture", + "fullscreen": "Fullscreen", + "exit-fullscreen": "Exit fullscreen" + }, "protected_session": { "enter_password_instruction": "Showing protected note requires entering your password:", "start_session_button": "Start protected session", diff --git a/apps/client/src/widgets/type_widgets/file/Video.tsx b/apps/client/src/widgets/type_widgets/file/Video.tsx index 511fd6c25c..d6f2448235 100644 --- a/apps/client/src/widgets/type_widgets/file/Video.tsx +++ b/apps/client/src/widgets/type_widgets/file/Video.tsx @@ -4,6 +4,7 @@ import { RefObject } from "preact"; import { useCallback, useEffect, useRef, useState } from "preact/hooks"; import FNote from "../../../entities/fnote"; +import { t } from "../../../services/i18n"; import { getUrlForDownload } from "../../../services/open"; import ActionButton from "../../react/ActionButton"; import Dropdown from "../../react/Dropdown"; @@ -116,9 +117,9 @@ export default function VideoPreview({ note }: { note: FNote }) {
- + - +
@@ -177,7 +178,7 @@ function PlayPauseButton({ videoRef, playing }: { videoRef: RefObject ); @@ -280,7 +281,7 @@ function VolumeControl({ videoRef }: { videoRef: RefObject })
}) {speed}x } - title="Playback speed" + title={t("video.playback-speed")} > {PLAYBACK_SPEEDS.map((rate) => (
  • @@ -368,7 +369,7 @@ function LoopButton({ videoRef }: { videoRef: RefObject }) { ); @@ -401,7 +402,7 @@ function RotateButton({ videoRef }: { videoRef: RefObject }) { return ( ); @@ -444,7 +445,7 @@ function PictureInPictureButton({ videoRef }: { videoRef: RefObject ); @@ -473,7 +474,7 @@ function FullscreenButton({ targetRef }: { targetRef: RefObject }) return ( );