I18n human relay (#1761)

* feat(i18n): Add i18n support for Human Relay dialog without monitoring

* feat(i18n): add humanRelay.json translations for all supported languages

- Created English version as base translation
- Added translations for: ca, de, es, fr, hi, it, ja, ko, pl, pt-BR, tr, vi, zh-TW
- Verified all translations are complete with no missing entries
This commit is contained in:
Felix NyxJae 2025-03-18 21:36:48 +08:00 committed by GitHub
parent 7ef4841914
commit 3b116a2b21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 210 additions and 13 deletions

View file

@ -4,6 +4,7 @@ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, D
import { Textarea } from "../ui/textarea"
import { useClipboard } from "../ui/hooks"
import { Check, Copy, X } from "lucide-react"
import { useAppTranslation } from "@/i18n/TranslationContext"
interface HumanRelayDialogProps {
isOpen: boolean
@ -26,11 +27,12 @@ export const HumanRelayDialog: React.FC<HumanRelayDialogProps> = ({
onSubmit,
onCancel,
}) => {
const { t } = useAppTranslation()
const [response, setResponse] = React.useState("")
const { copy } = useClipboard()
const [isCopyClicked, setIsCopyClicked] = React.useState(false)
// Listen to isOpen changes, clear the input box when the dialog box is opened
// Clear input when dialog opens
React.useEffect(() => {
if (isOpen) {
setResponse("")
@ -38,7 +40,7 @@ export const HumanRelayDialog: React.FC<HumanRelayDialogProps> = ({
}
}, [isOpen])
// Copy to clipboard and show a success message
// Copy to clipboard and show success message
const handleCopy = () => {
copy(promptText)
setIsCopyClicked(true)
@ -47,7 +49,7 @@ export const HumanRelayDialog: React.FC<HumanRelayDialogProps> = ({
}, 2000)
}
// Submit the response
// Submit response
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault()
if (response.trim()) {
@ -56,7 +58,7 @@ export const HumanRelayDialog: React.FC<HumanRelayDialogProps> = ({
}
}
// Cancel the operation
// Cancel operation
const handleCancel = () => {
onCancel(requestId)
onClose()
@ -66,10 +68,8 @@ export const HumanRelayDialog: React.FC<HumanRelayDialogProps> = ({
<Dialog open={isOpen} onOpenChange={(open) => !open && handleCancel()}>
<DialogContent className="sm:max-w-[600px]">
<DialogHeader>
<DialogTitle>Human Relay - Please Help Copy and Paste Information</DialogTitle>
<DialogDescription>
Please copy the text below to the web AI, then paste the AI's response into the input box below.
</DialogDescription>
<DialogTitle>{t("humanRelay:dialogTitle")}</DialogTitle>
<DialogDescription>{t("humanRelay:dialogDescription")}</DialogDescription>
</DialogHeader>
<div className="grid gap-4 py-4">
@ -84,12 +84,14 @@ export const HumanRelayDialog: React.FC<HumanRelayDialogProps> = ({
</Button>
</div>
{isCopyClicked && <div className="text-sm text-emerald-500 font-medium">Copied to clipboard</div>}
{isCopyClicked && (
<div className="text-sm text-emerald-500 font-medium">{t("humanRelay:copiedToClipboard")}</div>
)}
<div>
<div className="mb-2 font-medium">Please enter the AI's response:</div>
<div className="mb-2 font-medium">{t("humanRelay:aiResponse.label")}</div>
<Textarea
placeholder="Paste the AI's response here..."
placeholder={t("humanRelay:aiResponse.placeholder")}
value={response}
onChange={(e) => setResponse(e.target.value)}
className="min-h-[150px]"
@ -100,11 +102,11 @@ export const HumanRelayDialog: React.FC<HumanRelayDialogProps> = ({
<DialogFooter>
<Button variant="outline" onClick={handleCancel} className="gap-1">
<X className="h-4 w-4" />
Cancel
{t("humanRelay:actions.cancel")}
</Button>
<Button onClick={handleSubmit} disabled={!response.trim()} className="gap-1">
<Check className="h-4 w-4" />
Submit
{t("humanRelay:actions.submit")}
</Button>
</DialogFooter>
</DialogContent>

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "Relé Humà - Si us plau, ajudeu a copiar/enganxar informació",
"dialogDescription": "Si us plau, copieu el següent prompt a la IA web, després enganxeu la resposta de la IA al quadre d'entrada de sota.",
"copiedToClipboard": "Copiat al porta-retalls",
"aiResponse": {
"label": "Si us plau, introduïu la resposta de la IA:",
"placeholder": "Enganxeu aquí la resposta de la IA..."
},
"actions": {
"cancel": "Cancel·lar",
"submit": "Enviar"
}
}

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "Menschliche Weiterleitung - Bitte helfen Sie beim Kopieren/Einfügen von Informationen",
"dialogDescription": "Bitte kopieren Sie den folgenden Prompt in die Web-KI und fügen Sie dann die Antwort der KI in das Eingabefeld unten ein.",
"copiedToClipboard": "In die Zwischenablage kopiert",
"aiResponse": {
"label": "Bitte geben Sie die KI-Antwort ein:",
"placeholder": "KI-Antwort hier einfügen..."
},
"actions": {
"cancel": "Abbrechen",
"submit": "Absenden"
}
}

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "Human Relay - Please Help Copy/Paste Information",
"dialogDescription": "Please copy the following prompt to the web AI, then paste the AI's response in the input box below.",
"copiedToClipboard": "Copied to clipboard",
"aiResponse": {
"label": "Please enter AI's response:",
"placeholder": "Paste AI's response here..."
},
"actions": {
"cancel": "Cancel",
"submit": "Submit"
}
}

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "Relevo Humano - Por favor ayude a copiar/pegar información",
"dialogDescription": "Por favor copie el siguiente mensaje en la IA web, luego pegue la respuesta de la IA en el cuadro de entrada a continuación.",
"copiedToClipboard": "Copiado al portapapeles",
"aiResponse": {
"label": "Por favor ingrese la respuesta de la IA:",
"placeholder": "Pegue la respuesta de la IA aquí..."
},
"actions": {
"cancel": "Cancelar",
"submit": "Enviar"
}
}

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "Relais Humain - Veuillez aider à copier/coller les informations",
"dialogDescription": "Veuillez copier le texte suivant dans l'IA web, puis collez la réponse de l'IA dans la zone de saisie ci-dessous.",
"copiedToClipboard": "Copié dans le presse-papiers",
"aiResponse": {
"label": "Veuillez saisir la réponse de l'IA :",
"placeholder": "Collez la réponse de l'IA ici..."
},
"actions": {
"cancel": "Annuler",
"submit": "Envoyer"
}
}

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "मानव रिले - कृपया जानकारी कॉपी-पेस्ट करने में सहायता करें",
"dialogDescription": "कृपया निम्नलिखित प्रॉम्प्ट को वेब AI में कॉपी करें, फिर AI की प्रतिक्रिया को नीचे दिए गए इनपुट बॉक्स में पेस्ट करें।",
"copiedToClipboard": "क्लिपबोर्ड पर कॉपी किया गया",
"aiResponse": {
"label": "कृपया AI की प्रतिक्रिया दर्ज करें:",
"placeholder": "यहाँ AI की प्रतिक्रिया पेस्ट करें..."
},
"actions": {
"cancel": "रद्द करें",
"submit": "जमा करें"
}
}

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "Relay Umano - Aiuta a copiare/incollare le informazioni",
"dialogDescription": "Copia il seguente prompt nell'AI web, quindi incolla la risposta dell'AI nella casella di input sottostante.",
"copiedToClipboard": "Copiato negli appunti",
"aiResponse": {
"label": "Inserisci la risposta dell'AI:",
"placeholder": "Incolla qui la risposta dell'AI..."
},
"actions": {
"cancel": "Annulla",
"submit": "Invia"
}
}

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "ヒューマンリレー - 情報のコピー&ペーストにご協力ください",
"dialogDescription": "以下のプロンプトをウェブAIにコピーし、AIの応答を下の入力ボックスにペーストしてください。",
"copiedToClipboard": "クリップボードにコピーしました",
"aiResponse": {
"label": "AIの応答を入力してください",
"placeholder": "ここにAIの応答をペースト..."
},
"actions": {
"cancel": "キャンセル",
"submit": "送信"
}
}

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "휴먼 릴레이 - 정보 복사/붙여넣기를 도와주세요",
"dialogDescription": "다음 프롬프트를 웹 AI에 복사하고, AI의 응답을 아래 입력창에 붙여넣어 주세요.",
"copiedToClipboard": "클립보드에 복사됨",
"aiResponse": {
"label": "AI의 응답을 입력해주세요:",
"placeholder": "여기에 AI의 응답을 붙여넣으세요..."
},
"actions": {
"cancel": "취소",
"submit": "제출"
}
}

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "Przekaźnik Ludzki - Pomóż skopiować/wkleić informacje",
"dialogDescription": "Skopiuj poniższy prompt do AI w przeglądarce, a następnie wklej odpowiedź AI do pola wprowadzania poniżej.",
"copiedToClipboard": "Skopiowano do schowka",
"aiResponse": {
"label": "Wprowadź odpowiedź AI:",
"placeholder": "Wklej tutaj odpowiedź AI..."
},
"actions": {
"cancel": "Anuluj",
"submit": "Wyślij"
}
}

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "Retransmissão Humana - Ajude a copiar/colar informações",
"dialogDescription": "Por favor, copie o seguinte prompt para a IA web e depois cole a resposta da IA na caixa de entrada abaixo.",
"copiedToClipboard": "Copiado para a área de transferência",
"aiResponse": {
"label": "Digite a resposta da IA:",
"placeholder": "Cole a resposta da IA aqui..."
},
"actions": {
"cancel": "Cancelar",
"submit": "Enviar"
}
}

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "İnsan Aktarımı - Lütfen bilgileri kopyalama/yapıştırmada yardımcı olun",
"dialogDescription": "Lütfen aşağıdaki metni web AI'ya kopyalayın, ardından AI'nın yanıtını aşağıdaki giriş kutusuna yapıştırın.",
"copiedToClipboard": "Panoya kopyalandı",
"aiResponse": {
"label": "Lütfen AI yanıtını girin:",
"placeholder": "AI yanıtını buraya yapıştırın..."
},
"actions": {
"cancel": "İptal",
"submit": "Gönder"
}
}

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "Chuyển tiếp Thủ công - Vui lòng giúp Sao chép/Dán thông tin",
"dialogDescription": "Vui lòng sao chép đoạn nhắc sau vào AI web, sau đó dán phản hồi của AI vào hộp nhập liệu bên dưới.",
"copiedToClipboard": "Đã sao chép vào clipboard",
"aiResponse": {
"label": "Vui lòng nhập phản hồi của AI:",
"placeholder": "Dán phản hồi của AI vào đây..."
},
"actions": {
"cancel": "Hủy",
"submit": "Gửi"
}
}

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "人工中继 - 请协助复制粘贴信息",
"dialogDescription": "请将以下提示词复制到网页AI然后将AI的回复粘贴到下方的输入框中。",
"copiedToClipboard": "已复制到剪贴板",
"aiResponse": {
"label": "请输入AI的回复",
"placeholder": "在此粘贴AI的回复..."
},
"actions": {
"cancel": "取消",
"submit": "提交"
}
}

View file

@ -0,0 +1,13 @@
{
"dialogTitle": "人工中繼 - 請協助複製貼上訊息",
"dialogDescription": "請將以下提示詞複製到網頁AI然後將AI的回覆貼上到下方的輸入框中。",
"copiedToClipboard": "已複製到剪貼簿",
"aiResponse": {
"label": "請輸入AI的回覆",
"placeholder": "在此貼上AI的回覆..."
},
"actions": {
"cancel": "取消",
"submit": "提交"
}
}