From 0f5833165416972e3c57a770048d0622310a5dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Sun, 23 Aug 2026 14:06:31 +0000 Subject: [PATCH] qr transfer panel keyed (573 -> 569) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Its two appRegistryMetas names are left for now — see the note in the dav commit. --- .../officerdev/src/apps/QrTransfer/Receiver.tsx | 14 ++++++-------- .../officerdev/src/apps/QrTransfer/Sender.tsx | 17 ++++++----------- .../officerdev/src/locales/en-GB.json | 12 ++++++++++++ .../officerdev/src/locales/pt-PT.json | 12 ++++++++++++ 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/src/workspaces/officerdev/src/apps/QrTransfer/Receiver.tsx b/src/workspaces/officerdev/src/apps/QrTransfer/Receiver.tsx index 436b91b7..0372f0b1 100644 --- a/src/workspaces/officerdev/src/apps/QrTransfer/Receiver.tsx +++ b/src/workspaces/officerdev/src/apps/QrTransfer/Receiver.tsx @@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import jsQR from 'jsqr'; import { Camera, Download, RotateCcw } from 'lucide-react'; import { crc32, decodeFrame, reassemble, type MetaFrame } from './protocol'; +import { useTranslation } from '../../locales'; // Receiver: camera → jsQR → collect frames until every index is present. // @@ -15,6 +16,7 @@ import { crc32, decodeFrame, reassemble, type MetaFrame } from './protocol'; type Progress = { meta: MetaFrame; have: number }; export const QrReceiver = () => { + const { t } = useTranslation(); const videoRef = useRef(null); const canvasRef = useRef(null); const chunksRef = useRef(new Map()); @@ -130,7 +132,7 @@ export const QrReceiver = () => { className="flex cursor-pointer items-center gap-2 rounded-md border border-duck-dark/20 px-3 py-2 text-sm text-duck-dark/80 hover:border-duck-teal hover:text-duck-teal" > - Start scanning + {t('qrTransfer.startScanning')} )} @@ -172,18 +174,14 @@ export const QrReceiver = () => { className="flex cursor-pointer items-center gap-1 text-xs text-duck-dark/50 hover:text-duck-teal" > - Receive another + {t('qrTransfer.receiveAnother')} )} {scanning && ( - )} diff --git a/src/workspaces/officerdev/src/apps/QrTransfer/Sender.tsx b/src/workspaces/officerdev/src/apps/QrTransfer/Sender.tsx index ae00a7b3..31629f8a 100644 --- a/src/workspaces/officerdev/src/apps/QrTransfer/Sender.tsx +++ b/src/workspaces/officerdev/src/apps/QrTransfer/Sender.tsx @@ -1,14 +1,8 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import QRCode from 'qrcode'; import { Upload, Play, Pause } from 'lucide-react'; -import { - chunkFile, - crc32, - encodeData, - encodeMeta, - newSessionId, - DEFAULT_CHUNK_BYTES, -} from './protocol'; +import { chunkFile, crc32, encodeData, encodeMeta, newSessionId, DEFAULT_CHUNK_BYTES } from './protocol'; +import { useTranslation } from '../../locales'; // Sender: a file becomes a looping carousel of QR frames. // @@ -24,6 +18,7 @@ const META_EVERY = 12; const SPEEDS = [4, 6, 8, 12] as const; export const QrSender = () => { + const { t } = useTranslation(); const canvasRef = useRef(null); const [file, setFile] = useState<{ name: string; mime: string; bytes: Uint8Array } | null>(null); const [frames, setFrames] = useState([]); @@ -82,7 +77,7 @@ export const QrSender = () => {

- Keep this on screen until the receiver reports 100%. It loops forever — a missed frame is - picked up on the next pass. + Keep this on screen until the receiver reports 100%. It loops forever — a missed frame is picked up on the + next pass.

)} diff --git a/src/workspaces/officerdev/src/locales/en-GB.json b/src/workspaces/officerdev/src/locales/en-GB.json index 86fb3306..7aabc408 100644 --- a/src/workspaces/officerdev/src/locales/en-GB.json +++ b/src/workspaces/officerdev/src/locales/en-GB.json @@ -11,5 +11,17 @@ "unknownMessage": "The VNC server sent an unknown message type ({{type}}).", "unknownEncoding": "The VNC server used encoding {{encoding}}, which this client did not ask for." } + }, + "qrTransfer": { + "chooseFile": "Choose a file to send", + "startScanning": "Start scanning", + "receiveAnother": "Receive another", + "stop": "Stop" + }, + "dav": { + "empty": "Nothing here yet. Add one from a phone or desktop client over CalDAV/CardDAV.", + "calendar": "Calendar", + "contacts": "Contacts", + "readFailed": "Could not read {{name}}: {{reason}}" } } diff --git a/src/workspaces/officerdev/src/locales/pt-PT.json b/src/workspaces/officerdev/src/locales/pt-PT.json index 83cbeb86..46f29cf4 100644 --- a/src/workspaces/officerdev/src/locales/pt-PT.json +++ b/src/workspaces/officerdev/src/locales/pt-PT.json @@ -11,5 +11,17 @@ "unknownMessage": "O servidor VNC enviou um tipo de mensagem desconhecido ({{type}}).", "unknownEncoding": "O servidor VNC usou a codificação {{encoding}}, que este cliente não pediu." } + }, + "qrTransfer": { + "chooseFile": "Escolha um ficheiro para enviar", + "startScanning": "Começar a digitalizar", + "receiveAnother": "Receber outro", + "stop": "Parar" + }, + "dav": { + "empty": "Ainda não há nada aqui. Adicione um a partir de um cliente de telemóvel ou computador por CalDAV/CardDAV.", + "calendar": "Calendário", + "contacts": "Contactos", + "readFailed": "Não foi possível ler {{name}}: {{reason}}" } }