From e3cb85271cb82b0b5216798683238a5e3ec3793c Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sun, 28 Dec 2025 11:56:58 +0200 Subject: [PATCH] Translate /contact --- web/components/contact.tsx | 19 ++++++++++++------- web/messages/fr.json | 9 +++++++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/web/components/contact.tsx b/web/components/contact.tsx index 7d71a4ee..e8f3e68f 100644 --- a/web/components/contact.tsx +++ b/web/components/contact.tsx @@ -10,24 +10,29 @@ import {Title} from "web/components/widgets/title"; import toast from "react-hot-toast"; import Link from "next/link"; import {formLink} from "common/constants"; +import {useT} from 'web/lib/locale' // added export function ContactComponent() { const user = useUser() + const t = useT() // use translations const editor = useTextEditor({ max: MAX_DESCRIPTION_LENGTH, defaultValue: '', - placeholder: 'Contact us here...', + placeholder: t('contact.editor.placeholder', 'Contact us here...'), // localized placeholder }) const showButton = !!editor?.getText().length return ( - Contact + {t('contact.title', 'Contact')}

- You can also contact us through this feedback form or any of our socials. Feel free to give your contact information if you'd like us to get back to you. + {t('contact.intro_prefix', "You can also contact us through this ")} + {t('contact.form_link', 'feedback form')} + {t('contact.intro_middle', ' or any of our ')} + {t('contact.socials', 'socials')} + {t('contact.intro_suffix', ". Feel free to give your contact information if you'd like us to get back to you.")}

@@ -46,14 +51,14 @@ export function ContactComponent() { userId: user?.id, }; const result = await api('contact', data).catch(() => { - toast.error('Failed to contact — try again or contact us...') + toast.error(t('contact.toast.failed', 'Failed to contact — try again or contact us...')) }) if (!result) return editor.commands.clearContent() - toast.success('Thank you for your message!') + toast.success(t('contact.toast.success', 'Thank you for your message!')) }} > - Submit + {t('contact.submit', 'Submit')} )} diff --git a/web/messages/fr.json b/web/messages/fr.json index 4373da83..335aade6 100644 --- a/web/messages/fr.json +++ b/web/messages/fr.json @@ -115,6 +115,15 @@ "contact.seo.title": "Contact", "contact.seo.description": "Contactez-nous", "contact.title": "Contact", + "contact.intro_prefix": "Vous pouvez aussi nous contacter via ce ", + "contact.form_link": "formulaire de retour", + "contact.intro_middle": " ou via nos ", + "contact.socials": "réseaux", + "contact.intro_suffix": ". N'hésitez pas à laisser vos coordonnées si vous souhaitez que nous revenions vers vous.", + "contact.editor.placeholder": "Contactez-nous ici...", + "contact.submit": "Envoyer", + "contact.toast.failed": "Échec de l'envoi — réessayez ou contactez-nous...", + "contact.toast.success": "Merci pour votre message !", "vote.seo.title": "Propositions", "vote.seo.description": "Un endroit pour voter sur les décisions", "vote.title": "Propositions",