From e3e790fd2b7af6128ece4fcdcd4675b96fb5030d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Sun, 23 Aug 2026 04:16:54 +0000 Subject: [PATCH] command block and colour picker keyed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ColorPicker's one string was placeholder="Font Weight" on an , where a placeholder is both wrong text and inert — browsers do not render one on a colour input. Keyed it as ui.colorPicker.placeholder and moved it to the hex text field beside it, which is a real text input and had none. Translating it in place would have created a key guaranteed never to be seen. Both files still have no importers; CommandBlock stays because commands the user might run need a copy button by convention. --- src/workspaces/components/ColorPicker.tsx | 10 +++++++--- src/workspaces/components/CommandBlock.tsx | 8 +++++--- src/workspaces/components/locales/en-GB.json | 7 +++++++ src/workspaces/components/locales/pt-PT.json | 7 +++++++ 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/workspaces/components/ColorPicker.tsx b/src/workspaces/components/ColorPicker.tsx index 989e52cb..bd722854 100644 --- a/src/workspaces/components/ColorPicker.tsx +++ b/src/workspaces/components/ColorPicker.tsx @@ -1,11 +1,15 @@ import { Input } from '@/components/ui/input'; +import { useTranslation } from '@/components/locales'; type ColorPickerProps = { value?: string; name: string; label?: string }; export const ColorPicker = (props: ColorPickerProps) => { const { value = '#000000', name, label } = props; + const { t } = useTranslation(); return (
- {label && {label}} + {label && ( + {label} + )}
{ className="absolute h-12 w-24 rounded-full border-0 text-lg" type="color" name={name} - placeholder="Font Weight" />
diff --git a/src/workspaces/components/CommandBlock.tsx b/src/workspaces/components/CommandBlock.tsx index b90bcc10..f7c258ab 100644 --- a/src/workspaces/components/CommandBlock.tsx +++ b/src/workspaces/components/CommandBlock.tsx @@ -1,6 +1,7 @@ import { useState } from 'react'; import { Copy, Check, Play } from 'lucide-react'; import { copyToClipboard } from 'helpers/clipboard'; +import { useTranslation } from '@/components/locales'; type CommandBlockProps = { label?: string; @@ -9,6 +10,7 @@ type CommandBlockProps = { }; export const CommandBlock = ({ label, command, onRun }: CommandBlockProps) => { + const { t } = useTranslation(); const [copied, setCopied] = useState(false); const copy = () => { @@ -20,14 +22,14 @@ export const CommandBlock = ({ label, command, onRun }: CommandBlockProps) => { return (
{label && {label}} -
+
{command} {onRun && ( @@ -36,7 +38,7 @@ export const CommandBlock = ({ label, command, onRun }: CommandBlockProps) => { type="button" onClick={copy} className="shrink-0 p-1.5 rounded hover:bg-white/10 cursor-pointer transition-colors" - title="Copy command" + title={t('commandBlock.copy')} > {copied ? : } diff --git a/src/workspaces/components/locales/en-GB.json b/src/workspaces/components/locales/en-GB.json index 1c2cadce..2fcdab19 100644 --- a/src/workspaces/components/locales/en-GB.json +++ b/src/workspaces/components/locales/en-GB.json @@ -17,6 +17,13 @@ "tabs": { "filterPlaceholder": "Filter" }, + "commandBlock": { + "run": "Run in terminal", + "copy": "Copy command" + }, + "colorPicker": { + "placeholder": "Hex colour" + }, "state": { "loading": "Loading…" }, diff --git a/src/workspaces/components/locales/pt-PT.json b/src/workspaces/components/locales/pt-PT.json index 743c0f7f..bed51b5e 100644 --- a/src/workspaces/components/locales/pt-PT.json +++ b/src/workspaces/components/locales/pt-PT.json @@ -17,6 +17,13 @@ "tabs": { "filterPlaceholder": "Filtrar" }, + "commandBlock": { + "run": "Executar no terminal", + "copy": "Copiar comando" + }, + "colorPicker": { + "placeholder": "Cor hexadecimal" + }, "state": { "loading": "A carregar…" },