feat(i18n): add multilingual support to Contact Us modal and fix translations

**Contact Modal:**
- Added complete DE/FR translations for contact form
- Added 17 data-i18n attributes to modal elements
- Form labels, buttons, messages now translate
- Languages: EN, DE (Nachricht senden), FR (Envoyer le message)

**Fixed Translations:**
- media-inquiry.json: Fixed "Your Name" → "Ihr Name" (DE), "Votre nom" (FR)
- common.json: Added contact_modal section with all form text

**Translations Added:**
- Modal heading, description, all form labels
- Inquiry type options (general, partnership, technical, feedback)
- Submit/cancel buttons, success/error messages
- Dynamic "Sending..." text (Senden.../Envoi en cours...)

**Technical:**
- Contact modal in footer.js now fully i18n-enabled
- Uses window.I18n.translations for dynamic content
- All text translates when language selector is used

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
TheFlow 2025-10-26 16:57:47 +13:00
parent b56b6a68a0
commit a69d12b5ba
5 changed files with 90 additions and 21 deletions

View file

@ -124,58 +124,58 @@
<div class="bg-white rounded-lg shadow-xl max-w-lg w-full mx-4 max-h-[90vh] overflow-y-auto">
<div class="p-6">
<div class="flex items-center justify-between mb-4">
<h2 class="text-2xl font-bold text-gray-900">Contact Us</h2>
<h2 data-i18n="contact_modal.heading" class="text-2xl font-bold text-gray-900">Contact Us</h2>
<button id="close-contact-modal" class="text-gray-400 hover:text-gray-600 text-2xl leading-none">&times;</button>
</div>
<p class="text-gray-600 mb-6">Have a question or want to get in touch? Fill out the form below and we'll respond within 24 hours.</p>
<p data-i18n="contact_modal.description" class="text-gray-600 mb-6">Have a question or want to get in touch? Fill out the form below and we'll respond within 24 hours.</p>
<form id="contact-form" class="space-y-4">
<!-- Type -->
<div>
<label for="contact-type" class="block text-sm font-medium text-gray-700 mb-1">Inquiry Type</label>
<label for="contact-type" data-i18n="contact_modal.type_label" class="block text-sm font-medium text-gray-700 mb-1">Inquiry Type</label>
<select id="contact-type" name="type" required class="w-full border border-gray-300 rounded-md px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option value="general">General Inquiry</option>
<option value="partnership">Partnership</option>
<option value="technical">Technical Support</option>
<option value="feedback">Feedback</option>
<option value="general" data-i18n="contact_modal.type_options.general">General Inquiry</option>
<option value="partnership" data-i18n="contact_modal.type_options.partnership">Partnership</option>
<option value="technical" data-i18n="contact_modal.type_options.technical">Technical Support</option>
<option value="feedback" data-i18n="contact_modal.type_options.feedback">Feedback</option>
</select>
</div>
<!-- Name -->
<div>
<label for="contact-name" class="block text-sm font-medium text-gray-700 mb-1">Name *</label>
<label for="contact-name" data-i18n="contact_modal.name_label" class="block text-sm font-medium text-gray-700 mb-1">Name *</label>
<input type="text" id="contact-name" name="name" required maxlength="100" class="w-full border border-gray-300 rounded-md px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
<!-- Email -->
<div>
<label for="contact-email" class="block text-sm font-medium text-gray-700 mb-1">Email *</label>
<label for="contact-email" data-i18n="contact_modal.email_label" class="block text-sm font-medium text-gray-700 mb-1">Email *</label>
<input type="email" id="contact-email" name="email" required maxlength="254" class="w-full border border-gray-300 rounded-md px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
<!-- Organization (optional) -->
<div>
<label for="contact-organization" class="block text-sm font-medium text-gray-700 mb-1">Organization (optional)</label>
<label for="contact-organization" data-i18n="contact_modal.organization_label" class="block text-sm font-medium text-gray-700 mb-1">Organization (optional)</label>
<input type="text" id="contact-organization" name="organization" maxlength="200" class="w-full border border-gray-300 rounded-md px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
<!-- Subject (optional) -->
<div>
<label for="contact-subject" class="block text-sm font-medium text-gray-700 mb-1">Subject (optional)</label>
<label for="contact-subject" data-i18n="contact_modal.subject_label" class="block text-sm font-medium text-gray-700 mb-1">Subject (optional)</label>
<input type="text" id="contact-subject" name="subject" maxlength="200" class="w-full border border-gray-300 rounded-md px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
<!-- Message -->
<div>
<label for="contact-message" class="block text-sm font-medium text-gray-700 mb-1">Message *</label>
<label for="contact-message" data-i18n="contact_modal.message_label" class="block text-sm font-medium text-gray-700 mb-1">Message *</label>
<textarea id="contact-message" name="message" required maxlength="5000" rows="5" class="w-full border border-gray-300 rounded-md px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-blue-500"></textarea>
<p class="text-xs text-gray-500 mt-1">Maximum 5000 characters</p>
<p data-i18n="contact_modal.message_help" class="text-xs text-gray-500 mt-1">Maximum 5000 characters</p>
</div>
<!-- Success Message -->
<div id="contact-success" class="hidden bg-green-50 border border-green-200 text-green-800 px-4 py-3 rounded">
Thank you for contacting us! We'll respond within 24 hours.
<span data-i18n="contact_modal.success_message">Thank you for contacting us! We will respond within 24 hours.</span>! We'll respond within 24 hours.
</div>
<!-- Error Message -->
@ -185,10 +185,10 @@
<!-- Actions -->
<div class="flex items-center justify-between pt-4">
<p class="text-sm text-gray-500">Or email us at <a href="mailto:hello@agenticgovernance.digital" class="text-blue-600 hover:underline">hello@agenticgovernance.digital</a></p>
<p class="text-sm text-gray-500"><span data-i18n="contact_modal.email_link_text">Or email us at</span> <a href="mailto:hello@agenticgovernance.digital" class="text-blue-600 hover:underline">hello@agenticgovernance.digital</a></p>
<div class="flex gap-2">
<button type="button" id="cancel-contact" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50">Cancel</button>
<button type="submit" id="contact-submit" class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700">Send Message</button>
<button type="button" id="cancel-contact" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50"data-i18n="contact_modal.cancel_button">Cancel</button>
<button type="submit" id="contact-submit" class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700"data-i18n="contact_modal.submit_button">Send Message</button>
</div>
</div>
</form>

View file

@ -27,5 +27,28 @@
"copyright": "John G Stroh. Lizenziert unter",
"license": "Apache 2.0",
"location": "Hergestellt in Aotearoa Neuseeland 🇳🇿"
},
"contact_modal": {
"heading": "Kontakt",
"description": "Haben Sie eine Frage oder möchten Sie Kontakt mit uns aufnehmen? Füllen Sie das untenstehende Formular aus und wir werden Ihnen innerhalb von 24 Stunden antworten.",
"type_label": "Anfrage Typ",
"type_options": {
"general": "Allgemeine Anfrage",
"partnership": "Partnerschaft",
"technical": "Technische Unterstützung",
"feedback": "Rückmeldung"
},
"name_label": "Name",
"email_label": "E-Mail",
"organization_label": "Organisation (fakultativ)",
"subject_label": "Thema (fakultativ)",
"message_label": "Nachricht",
"message_help": "Maximal 5000 Zeichen",
"email_link_text": "Oder senden Sie uns eine E-Mail an",
"cancel_button": "Abbrechen",
"submit_button": "Nachricht senden",
"success_message": "Vielen Dank, dass Sie mit uns Kontakt aufgenommen haben! Wir werden innerhalb von 24 Stunden antworten.",
"error_prefix": "Fehler:",
"submitting": "Senden..."
}
}
}

View file

@ -6,7 +6,7 @@
},
"form": {
"contact_info_heading": "Kontaktinformationen",
"contact_name_label": "Your Name",
"contact_name_label": "Ihr Name",
"contact_email_label": "E-Mail Adresse",
"contact_outlet_label": "Medienvertrieb/Organisation",
"contact_outlet_help": "Veröffentlichung, Website, Podcast oder Organisation, die Sie vertreten",

View file

@ -41,5 +41,28 @@
"research_case_studies_desc": "Academic foundations, failure mode analysis, governance research",
"contact": "Contact:",
"contact_text": "For pilot partnerships, validation studies, or technical consultation, contact via"
},
"contact_modal": {
"heading": "Contact Us",
"description": "Have a question or want to get in touch? Fill out the form below and we will respond within 24 hours.",
"type_label": "Inquiry Type",
"type_options": {
"general": "General Inquiry",
"partnership": "Partnership",
"technical": "Technical Support",
"feedback": "Feedback"
},
"name_label": "Name",
"email_label": "Email",
"organization_label": "Organization (optional)",
"subject_label": "Subject (optional)",
"message_label": "Message",
"message_help": "Maximum 5000 characters",
"email_link_text": "Or email us at",
"cancel_button": "Cancel",
"submit_button": "Send Message",
"success_message": "Thank you for contacting us! We will respond within 24 hours.",
"error_prefix": "Error: ",
"submitting": "Sending..."
}
}
}

View file

@ -27,5 +27,28 @@
"copyright": "John G Stroh. Sous licence",
"license": "Apache 2.0",
"location": "Fabriqué en Aotearoa Nouvelle-Zélande 🇳🇿"
},
"contact_modal": {
"heading": "Nous contacter",
"description": "Vous avez une question ou souhaitez prendre contact avec nous ? Remplissez le formulaire ci-dessous et nous vous répondrons dans les 24 heures.",
"type_label": "Type d'enquête",
"type_options": {
"general": "Enquête générale",
"partnership": "Partenariat",
"technical": "Support technique",
"feedback": "Retour d'information"
},
"name_label": "Nom",
"email_label": "Courriel",
"organization_label": "Organisation (facultatif)",
"subject_label": "Sujet (facultatif)",
"message_label": "Message",
"message_help": "Maximum 5000 caractères",
"email_link_text": "Ou envoyez-nous un courriel à l'adresse suivante",
"cancel_button": "Annuler",
"submit_button": "Envoyer le message",
"success_message": "Merci de nous avoir contactés ! Nous vous répondrons dans les 24 heures.",
"error_prefix": "Erreur :",
"submitting": "Envoi en cours..."
}
}
}