Kaynağa Gözat

feat: german translation, fix option newline parse, add freetext option

AI 2 gün önce
ebeveyn
işleme
35b0beffee
4 değiştirilmiş dosya ile 128 ekleme ve 68 silme
  1. 13 13
      admin.php
  2. 46 10
      answer.php
  3. 29 29
      create.php
  4. 40 16
      submit.php

+ 13 - 13
admin.php

@@ -7,13 +7,13 @@ $token = $_GET['token'] ?? '';
 // Basic checks
 $form_file = __DIR__ . '/data/forms/' . preg_replace('/[^a-zA-Z0-9_-]/', '', $form_id) . '.json';
 if (empty($form_id) || empty($token) || !file_exists($form_file)) {
-    die('<div style="font-family:sans-serif; text-align:center; padding:50px;"><h2>Access Denied</h2></div>');
+    die('<div style="font-family:sans-serif; text-align:center; padding:50px;"><h2>Zugriff verweigert</h2></div>');
 }
 
 $form_data = json_decode(file_get_contents($form_file), true);
 
 if ($token !== $form_data['admin_token']) {
-    die('<div style="font-family:sans-serif; text-align:center; padding:50px;"><h2>Invalid Token</h2></div>');
+    die('<div style="font-family:sans-serif; text-align:center; padding:50px;"><h2>Ungültiges Token</h2></div>');
 }
 
 $questions_map = [];
@@ -43,7 +43,7 @@ usort($submissions, function($a, $b) {
 $total_responses = count($submissions);
 ?>
 <!DOCTYPE html>
-<html lang="en">
+<html lang="de">
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -54,10 +54,10 @@ $total_responses = count($submissions);
     <header class="site-header">
         <div class="container header-inner">
             <div class="brand">
-                <span class="brand-title">Responses: <?= htmlspecialchars($form_data['title']) ?></span>
+                <span class="brand-title">Antworten: <?= htmlspecialchars($form_data['title']) ?></span>
             </div>
             <nav class="site-nav">
-                <a href="index.php" class="btn btn-secondary">Admin Home</a>
+                <a href="index.php" class="btn btn-secondary">Admin Startseite</a>
             </nav>
         </div>
     </header>
@@ -66,11 +66,11 @@ $total_responses = count($submissions);
         
         <div class="admin-stats mt-2 mb-3" style="display:flex; gap:1rem; flex-wrap:wrap;">
             <div class="panel stat-card" style="flex:1; min-width:200px; text-align:center; margin-bottom:0;">
-                <div style="font-size:0.9rem; color:var(--brand-muted);">Total Responses</div>
+                <div style="font-size:0.9rem; color:var(--brand-muted);">Gesamte Antworten</div>
                 <div class="stat-value" style="font-size:2rem; font-weight:700; color:var(--brand-accent);"><?= $total_responses ?></div>
             </div>
             <div class="panel stat-card" style="flex:2; min-width:300px; margin-bottom:0; display:flex; flex-direction:column; justify-content:center;">
-                <div style="font-size:0.9rem; color:var(--brand-muted);">Public Answering Link</div>
+                <div style="font-size:0.9rem; color:var(--brand-muted);">Öffentlicher Link (Antworten)</div>
                 <div style="margin-top:0.5rem;"><a href="answer.php?id=<?= htmlspecialchars($form_id) ?>" target="_blank">answer.php?id=<?= htmlspecialchars($form_id) ?></a></div>
             </div>
         </div>
@@ -80,8 +80,8 @@ $total_responses = count($submissions);
                 <table class="responsive-table">
                     <thead>
                         <tr>
-                            <th>Date</th>
-                            <th>Respondent</th>
+                            <th>Datum</th>
+                            <th>Antwortender</th>
                             <?php foreach ($form_data['questions'] as $q): ?>
                                 <th><?= htmlspecialchars($questions_map[$q['id']]) ?></th>
                             <?php endforeach; ?>
@@ -90,8 +90,8 @@ $total_responses = count($submissions);
                     <tbody>
                         <?php foreach ($submissions as $sub): ?>
                             <tr>
-                                <td data-label="Date"><?= date('Y-m-d H:i', strtotime($sub['submitted_at'])) ?></td>
-                                <td data-label="Respondent">
+                                <td data-label="Datum"><?= date('Y-m-d H:i', strtotime($sub['submitted_at'])) ?></td>
+                                <td data-label="Antwortender">
                                     <strong><?= htmlspecialchars($sub['respondent_name']) ?></strong><br>
                                     <span style="font-size:0.8rem; color:var(--brand-muted);"><?= htmlspecialchars($sub['respondent_email']) ?></span>
                                 </td>
@@ -111,8 +111,8 @@ $total_responses = count($submissions);
             </div>
         <?php else: ?>
             <div class="panel text-center">
-                <h3 style="color:var(--brand-muted);">No responses yet.</h3>
-                <p>Share the public link to start collecting data.</p>
+                <h3 style="color:var(--brand-muted);">Noch keine Antworten.</h3>
+                <p>Teilen Sie den öffentlichen Link, um Daten zu sammeln.</p>
             </div>
         <?php endif; ?>
 

+ 46 - 10
answer.php

@@ -5,7 +5,7 @@ $form_id = $_GET['id'] ?? '';
 $form_file = __DIR__ . '/data/forms/' . preg_replace('/[^a-zA-Z0-9_-]/', '', $form_id) . '.json';
 
 if (empty($form_id) || !file_exists($form_file)) {
-    die('<div style="font-family:sans-serif; text-align:center; padding:50px;"><h2>Form Not Found</h2><p>The link may be invalid or expired.</p></div>');
+    die('<div style="font-family:sans-serif; text-align:center; padding:50px;"><h2>Formular nicht gefunden</h2><p>Der Link ist möglicherweise ungültig oder abgelaufen.</p></div>');
 }
 
 $form_data = json_decode(file_get_contents($form_file), true);
@@ -24,11 +24,11 @@ if ($edit_id) {
 }
 ?>
 <!DOCTYPE html>
-<html lang="en">
+<html lang="de">
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title><?= htmlspecialchars($form_data['title']) ?> - Intranet Forms</title>
+    <title><?= htmlspecialchars($form_data['title']) ?> - Intranet Formulare</title>
     <link rel="stylesheet" href="assets/css/style.css">
 </head>
 <body>
@@ -43,7 +43,7 @@ if ($edit_id) {
     <main class="container">
         <!-- Error tracking container (JS managed) -->
         <div id="already-submitted-alert" class="alert alert-warning" style="display:none;">
-            You have already submitted this form. <a href="submit.php?id=<?= htmlspecialchars($form_id) ?>" style="font-weight:bold;">View your answers</a>
+            Sie haben dieses Formular bereits ausgefüllt. <a href="submit.php?id=<?= htmlspecialchars($form_id) ?>" style="font-weight:bold;">Ihre Antworten ansehen</a>
         </div>
 
         <form action="submit.php" method="POST" id="answer-form">
@@ -58,21 +58,21 @@ if ($edit_id) {
                     <p style="margin-bottom:1rem; color:var(--brand-muted);"><?= nl2br(htmlspecialchars($form_data['description'])) ?></p>
                 <?php endif; ?>
                 
-                <h3 style="border-bottom: 1px solid var(--brand-border); padding-bottom: 0.5rem; margin-bottom: 1rem;">Respondent Details</h3>
+                <h3 style="border-bottom: 1px solid var(--brand-border); padding-bottom: 0.5rem; margin-bottom: 1rem;">Ihre Daten</h3>
                 
                 <div class="form-group">
-                    <label for="respondent_name">Your Name *</label>
+                    <label for="respondent_name">Ihr Name *</label>
                     <input type="text" id="respondent_name" name="respondent_name" required>
                 </div>
                 
                 <div class="form-group">
-                    <label for="respondent_email">Your Email (Optional, to receive a copy)</label>
+                    <label for="respondent_email">Ihre E-Mail (Optional, um eine Kopie zu erhalten)</label>
                     <input type="email" id="respondent_email" name="respondent_email">
                 </div>
             </div>
 
             <div class="panel">
-                <h3 style="border-bottom: 1px solid var(--brand-border); padding-bottom: 0.5rem; margin-bottom: 1rem;">Questions</h3>
+                <h3 style="border-bottom: 1px solid var(--brand-border); padding-bottom: 0.5rem; margin-bottom: 1rem;">Fragen</h3>
                 
                 <?php foreach ($form_data['questions'] as $q): ?>
                     <div class="form-group">
@@ -81,6 +81,25 @@ if ($edit_id) {
                         $val = $existing_answers[$q['id']] ?? ''; 
                         $is_array_val = is_array($val);
                         
+                        $is_freetext_val = false;
+                        $freetext_content = '';
+                        
+                        if ($q['type'] === 'single_choice') {
+                            if (!empty($val) && !in_array($val, $q['options'])) {
+                                $is_freetext_val = true;
+                                $freetext_content = $val;
+                            }
+                        } elseif ($q['type'] === 'multiple_choice') {
+                            if ($is_array_val) {
+                                foreach ($val as $v) {
+                                    if (!in_array($v, $q['options'])) {
+                                        $is_freetext_val = true;
+                                        $freetext_content = $v;
+                                    }
+                                }
+                            }
+                        }
+
                         if ($q['type'] === 'textarea'): ?>
                             <textarea id="<?= htmlspecialchars($q['id']) ?>" name="answers[<?= htmlspecialchars($q['id']) ?>]" rows="4" required><?= htmlspecialchars(is_string($val) ? $val : '') ?></textarea>
                         
@@ -94,6 +113,13 @@ if ($edit_id) {
                                         <?= htmlspecialchars($opt) ?>
                                     </label>
                                 <?php endforeach; ?>
+                                <?php if (!empty($q['allow_free_text'])): ?>
+                                    <label style="font-weight:normal; display:flex; align-items:center; gap:0.5rem;">
+                                        <input type="radio" name="answers[<?= htmlspecialchars($q['id']) ?>]" value="__freetext__" required <?= $is_freetext_val ? 'checked' : '' ?> style="width:auto; margin:0;">
+                                        Sonstiges:
+                                        <input type="text" name="answers_freetext[<?= htmlspecialchars($q['id']) ?>]" value="<?= htmlspecialchars($freetext_content) ?>" style="margin-left: 0.5rem; flex:1;">
+                                    </label>
+                                <?php endif; ?>
                             </div>
 
                         <?php elseif ($q['type'] === 'multiple_choice'): ?>
@@ -106,11 +132,18 @@ if ($edit_id) {
                                         <?= htmlspecialchars($opt) ?>
                                     </label>
                                 <?php endforeach; ?>
+                                <?php if (!empty($q['allow_free_text'])): ?>
+                                    <label style="font-weight:normal; display:flex; align-items:center; gap:0.5rem;">
+                                        <input type="checkbox" name="answers[<?= htmlspecialchars($q['id']) ?>][]" value="__freetext__" <?= $is_freetext_val ? 'checked' : '' ?> style="width:auto; margin:0;">
+                                        Sonstiges:
+                                        <input type="text" name="answers_freetext[<?= htmlspecialchars($q['id']) ?>]" value="<?= htmlspecialchars($freetext_content) ?>" style="margin-left: 0.5rem; flex:1;">
+                                    </label>
+                                <?php endif; ?>
                             </div>
 
                         <?php elseif ($q['type'] === 'dropdown'): ?>
                             <select id="<?= htmlspecialchars($q['id']) ?>" name="answers[<?= htmlspecialchars($q['id']) ?>]" required>
-                                <option value="">-- Please select --</option>
+                                <option value="">-- Bitte auswählen --</option>
                                 <?php foreach ($q['options'] as $opt): 
                                     $selected = (is_string($val) && $val === $opt) ? 'selected' : '';
                                 ?>
@@ -126,7 +159,7 @@ if ($edit_id) {
             </div>
             
             <div class="panel text-center" style="background:transparent; border:none; box-shadow:none;">
-                <button type="submit" class="btn btn-block" style="font-size: 1.1rem; padding: 0.75rem;">Submit Answers</button>
+                <button type="submit" class="btn btn-block" style="font-size: 1.1rem; padding: 0.75rem;">Antworten senden</button>
             </div>
         </form>
     </main>
@@ -134,6 +167,9 @@ if ($edit_id) {
     <script>
         const formId = "<?= htmlspecialchars($form_id) ?>";
         const isEditMode = <?= $edit_id ? 'true' : 'false' ?>;
+        
+        // Remove 'required' from radios if checkbox group is used (not natively supported without JS, so let's ensure single choice allows form submission if freetext is present)
+        // For radio groups, 'required' works as long as they have the same name.
     </script>
     <script src="assets/js/answer.js"></script>
 </body>

+ 29 - 29
create.php

@@ -6,7 +6,7 @@ $form_created = false;
 $output_links = [];
 
 if ($_SERVER['REQUEST_METHOD'] === 'POST') {
-    $title = trim($_POST['title'] ?? 'Untitled Form');
+    $title = trim($_POST['title'] ?? 'Unbenanntes Formular');
     $description = trim($_POST['description'] ?? '');
     $admin_email = trim($_POST['admin_email'] ?? '');
     $questions_json = $_POST['questions'] ?? '[]';
@@ -14,7 +14,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
     $questions = json_decode($questions_json, true);
     
     if (empty($questions) || !is_array($questions)) {
-        $message = '<div class="alert alert-error">Please add at least one question.</div>';
+        $message = '<div class="alert alert-error">Bitte fügen Sie mindestens eine Frage hinzu.</div>';
     } else {
         $form_id = uniqid('form_');
         $admin_token = bin2hex(random_bytes(16));
@@ -53,11 +53,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
 
         // Send email if provided
         if (!empty($admin_email) && filter_var($admin_email, FILTER_VALIDATE_EMAIL)) {
-            $subject = "Your Intranet Form is Ready: $title";
-            $email_body = "Hello,\n\nYour form '$title' has been created.\n\n";
-            $email_body .= "Public Link for respondents:\n$answer_link\n\n";
-            $email_body .= "Secret Admin Link for you to view responses:\n$admin_link\n\n";
-            $email_body .= "Do not share the admin link.\n\nThank you.";
+            $subject = "Ihr Intranet Formular ist bereit: $title";
+            $email_body = "Guten Tag,\n\nIhr Formular '$title' wurde erfolgreich erstellt.\n\n";
+            $email_body .= "Öffentlicher Link (zum Teilen):\n$answer_link\n\n";
+            $email_body .= "Geheimer Admin-Link (für Antworten):\n$admin_link\n\n";
+            $email_body .= "Bitte geben Sie den Admin-Link nicht weiter.\n\nVielen Dank.";
             $headers = "From: no-reply@" . $host . "\r\n";
             @mail($admin_email, $subject, $email_body, $headers);
         }
@@ -67,18 +67,18 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
 }
 ?>
 <!DOCTYPE html>
-<html lang="en">
+<html lang="de">
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Create Form</title>
+    <title>Formular erstellen</title>
     <link rel="stylesheet" href="assets/css/style.css">
 </head>
 <body>
     <header class="site-header">
         <div class="container header-inner">
             <div class="brand">
-                <a href="index.php" class="brand-title" style="color:white;">Intranet Forms</a>
+                <a href="index.php" class="brand-title" style="color:white;">Intranet Formulare</a>
             </div>
         </div>
     </header>
@@ -86,23 +86,23 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
     <main class="container">
         <?php if ($form_created): ?>
             <div class="panel">
-                <h2 class="card-title" style="color: var(--brand-accent)">Form Created Successfully!</h2>
+                <h2 class="card-title" style="color: var(--brand-accent)">Formular erfolgreich erstellt!</h2>
                 <div class="alert alert-success mt-2">
-                    <strong>Public Answering Link (Share this):</strong><br>
+                    <strong>Öffentlicher Link (um Antworten zu sammeln):</strong><br>
                     <a href="<?= htmlspecialchars($output_links['answer']) ?>" target="_blank"><?= htmlspecialchars($output_links['answer']) ?></a>
                 </div>
                 
                 <div class="alert alert-info mt-2">
-                    <strong>Secret Admin Link (Keep this safe):</strong><br>
+                    <strong>Geheimer Admin-Link (Muss sicher aufbewahrt werden):</strong><br>
                     <a href="<?= htmlspecialchars($output_links['admin']) ?>" target="_blank"><?= htmlspecialchars($output_links['admin']) ?></a>
                 </div>
                 
                 <?php if (!empty($admin_email)): ?>
-                    <p class="mt-2 text-center text-muted">A notification with these links has been sent to <?= htmlspecialchars($admin_email) ?></p>
+                    <p class="mt-2 text-center text-muted">Eine Benachrichtigung mit diesen Links wurde an <?= htmlspecialchars($admin_email) ?> gesendet.</p>
                 <?php endif; ?>
                 
                 <div class="mt-3 text-center">
-                    <a href="index.php" class="btn btn-secondary">Return Home</a>
+                    <a href="index.php" class="btn btn-secondary">Zurück zur Startseite</a>
                 </div>
             </div>
         <?php else: ?>
@@ -111,43 +111,43 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
             
             <form method="POST" id="form-builder-form">
                 <div class="panel">
-                    <h2 class="card-title">Form Settings</h2>
+                    <h2 class="card-title">Formulareinstellungen</h2>
                     <div class="form-group">
-                        <label for="title">Form Title *</label>
-                        <input type="text" id="title" name="title" required placeholder="e.g. Employee Satisfaction Survey">
+                        <label for="title">Formulartitel *</label>
+                        <input type="text" id="title" name="title" required placeholder="z.B. Mitarbeiterbefragung">
                     </div>
                     <div class="form-group">
-                        <label for="description">Description (Optional)</label>
-                        <textarea id="description" name="description" rows="3" placeholder="Explain the purpose of this form"></textarea>
+                        <label for="description">Beschreibung (Optional)</label>
+                        <textarea id="description" name="description" rows="3" placeholder="Erklären Sie den Zweck dieses Formulars"></textarea>
                     </div>
                     <div class="form-group">
-                        <label for="admin_email">Admin Email (Optional)</label>
-                        <input type="email" id="admin_email" name="admin_email" placeholder="We'll send the admin link here">
+                        <label for="admin_email">Admin-E-Mail (Optional)</label>
+                        <input type="email" id="admin_email" name="admin_email" placeholder="Wir senden den Admin-Link hierher">
                     </div>
                 </div>
 
                 <div class="panel">
                     <div style="display:flex; justify-content:space-between; align-items:center; margin-bottom: 1rem; flex-wrap:wrap; gap: 0.5rem">
-                        <h2 class="card-title">Questions</h2>
+                        <h2 class="card-title">Fragen</h2>
                         <div>
                             <button type="button" class="btn btn-small btn-secondary text-center mb-1" onclick="addQuestion('text')">+ Text</button>
-                            <button type="button" class="btn btn-small btn-secondary text-center mb-1" onclick="addQuestion('textarea')">+ Text Area</button>
-                            <button type="button" class="btn btn-small btn-secondary text-center mb-1" onclick="addQuestion('single_choice')">+ Single Choice</button>
-                            <button type="button" class="btn btn-small btn-secondary text-center mb-1" onclick="addQuestion('multiple_choice')">+ Multi Choice</button>
+                            <button type="button" class="btn btn-small btn-secondary text-center mb-1" onclick="addQuestion('textarea')">+ Textbereich</button>
+                            <button type="button" class="btn btn-small btn-secondary text-center mb-1" onclick="addQuestion('single_choice')">+ Einzelauswahl</button>
+                            <button type="button" class="btn btn-small btn-secondary text-center mb-1" onclick="addQuestion('multiple_choice')">+ Mehrfachauswahl</button>
                             <button type="button" class="btn btn-small btn-secondary text-center mb-1" onclick="addQuestion('dropdown')">+ Dropdown</button>
                         </div>
                     </div>
                     
                     <div id="builder-canvas">
-                        <div class="alert alert-info" id="empty-state">No questions added yet. Use the buttons above to add one.</div>
+                        <div class="alert alert-info" id="empty-state">Noch keine Fragen hinzugefügt. Verwenden Sie die Schaltflächen oben, um eine Frage hinzuzufügen.</div>
                     </div>
                     
                     <input type="hidden" name="questions" id="questions_input" value="[]">
                 </div>
                 
                 <div class="panel" style="text-align: right;">
-                    <a href="index.php" class="btn btn-secondary">Cancel</a>
-                    <button type="submit" class="btn" style="margin-left: 10px;" onclick="prepareSubmission(event)">Save Form</button>
+                    <a href="index.php" class="btn btn-secondary">Abbrechen</a>
+                    <button type="submit" class="btn" style="margin-left: 10px;" onclick="prepareSubmission(event)">Speichern</button>
                 </div>
             </form>
         <?php endif; ?>

+ 40 - 16
submit.php

@@ -12,7 +12,7 @@ $answer_id = $_REQUEST['answer_id'] ?? $_POST['edit_id'] ?? '';
 
 $form_file = __DIR__ . '/data/forms/' . preg_replace('/[^a-zA-Z0-9_-]/', '', $form_id) . '.json';
 if (empty($form_id) || !file_exists($form_file)) {
-    die('<div style="font-family:sans-serif; text-align:center; padding:50px;"><h2>Form Not Found</h2></div>');
+    die('<div style="font-family:sans-serif; text-align:center; padding:50px;"><h2>Formular nicht gefunden</h2></div>');
 }
 
 $form_data = json_decode(file_get_contents($form_file), true);
@@ -25,9 +25,33 @@ $injected_js = '';
 
 if ($is_post) {
     // Process form submission
-    $respondent_name = trim($_POST['respondent_name'] ?? 'Anonymous');
+    $respondent_name = trim($_POST['respondent_name'] ?? 'Anonym');
     $respondent_email = trim($_POST['respondent_email'] ?? '');
     $answers = $_POST['answers'] ?? [];
+    $answers_freetext = $_POST['answers_freetext'] ?? [];
+    
+    // Resolve free text substitutions
+    foreach ($answers as $q_id => $val) {
+        if (is_array($val)) {
+            $idx = array_search('__freetext__', $val);
+            if ($idx !== false) {
+                if (!empty($answers_freetext[$q_id])) {
+                    $val[$idx] = $answers_freetext[$q_id];
+                } else {
+                    unset($val[$idx]); // they selected 'Sonstiges' but left it blank
+                }
+                $answers[$q_id] = array_values($val);
+            }
+        } else {
+            if ($val === '__freetext__') {
+                if (!empty($answers_freetext[$q_id])) {
+                    $answers[$q_id] = $answers_freetext[$q_id];
+                } else {
+                    $answers[$q_id] = ''; // blank fallback
+                }
+            }
+        }
+    }
     
     $is_edit = !empty($answer_id);
     if (!$is_edit) {
@@ -52,11 +76,11 @@ if ($is_post) {
     
     // Email notification if provided
     if (!empty($respondent_email) && filter_var($respondent_email, FILTER_VALIDATE_EMAIL)) {
-        $subject = "Your submission for: " . $form_data['title'];
-        $body = "Hi $respondent_name,\n\nThank you for your submission.\nHere is what you submitted:\n\n";
+        $subject = "Ihre Einsendung für: " . $form_data['title'];
+        $body = "Hallo $respondent_name,\n\nVielen Dank für Ihre Einsendung.\nHier sind Ihre Antworten:\n\n";
         
         foreach ($answers as $q_id => $val) {
-            $label = $questions_map[$q_id] ?? 'Question';
+            $label = $questions_map[$q_id] ?? 'Frage';
             $val_str = is_array($val) ? implode(', ', $val) : $val;
             $body .= "$label:\n$val_str\n\n";
         }
@@ -77,17 +101,17 @@ $safe_answer_id = preg_replace('/[^a-zA-Z0-9_-]/', '', $answer_id);
 $answer_file = "$answers_dir/{$form_id}_{$safe_answer_id}.json";
 
 if (empty($safe_answer_id) || !file_exists($answer_file)) {
-    die('<div style="font-family:sans-serif; text-align:center; padding:50px;"><h2>Submission Not Found</h2></div>');
+    die('<div style="font-family:sans-serif; text-align:center; padding:50px;"><h2>Einsendung nicht gefunden</h2></div>');
 }
 
 $answer_data = json_decode(file_get_contents($answer_file), true);
 ?>
 <!DOCTYPE html>
-<html lang="en">
+<html lang="de">
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Submission Complete</title>
+    <title>Einsendung erfolgreich</title>
     <link rel="stylesheet" href="assets/css/style.css">
     <script>
         <?= $injected_js ?> // Output any localstorage writes if we didn't redirect (e.g. if we chose to drop the header(Location))
@@ -110,25 +134,25 @@ $answer_data = json_decode(file_get_contents($answer_file), true);
     <main class="container">
         <?php if ($success): ?>
             <div class="alert alert-success mt-3 mb-3">
-                Your response has been successfully saved.
+                Ihre Antwort wurde erfolgreich gespeichert.
                 <?php if (!empty($answer_data['respondent_email'])): ?>
-                    <br><small>A copy of your responses was sent to <?= htmlspecialchars($answer_data['respondent_email']) ?>.</small>
+                    <br><small>Eine Kopie Ihrer Antworten wurde gesendet an <?= htmlspecialchars($answer_data['respondent_email']) ?>.</small>
                 <?php endif; ?>
             </div>
         <?php endif; ?>
 
         <div class="panel">
-            <h2 class="card-title">Submitted Answers</h2>
+            <h2 class="card-title">Eingereichte Antworten</h2>
             <br>
             <table class="table-compact responsive-table">
                 <tbody>
                     <tr>
-                        <td data-label="Respondent"><strong><?= htmlspecialchars($answer_data['respondent_name']) ?></strong></td>
+                        <td data-label="Antwortender"><strong><?= htmlspecialchars($answer_data['respondent_name']) ?></strong></td>
                     </tr>
                     <?php foreach ($answer_data['answers'] as $q_id => $val): ?>
                         <tr>
-                            <td data-label="<?= htmlspecialchars($questions_map[$q_id] ?? 'Question') ?>">
-                                <div><strong style="color:var(--brand-muted); font-size:0.85rem;"><?= htmlspecialchars($questions_map[$q_id] ?? 'Question') ?></strong></div>
+                            <td data-label="<?= htmlspecialchars($questions_map[$q_id] ?? 'Frage') ?>">
+                                <div><strong style="color:var(--brand-muted); font-size:0.85rem;"><?= htmlspecialchars($questions_map[$q_id] ?? 'Frage') ?></strong></div>
                                 <div><?= nl2br(htmlspecialchars(is_array($val) ? implode(', ', $val) : $val)) ?></div>
                             </td>
                         </tr>
@@ -138,8 +162,8 @@ $answer_data = json_decode(file_get_contents($answer_file), true);
         </div>
 
         <div class="panel text-center" style="background:transparent; border:none; box-shadow:none;">
-            <a href="answer.php?id=<?= htmlspecialchars($form_id) ?>&edit=<?= htmlspecialchars($answer_data['answer_id']) ?>" class="btn mt-2">Edit Response</a>
-            <button onclick="clearAndAnswerNew()" class="btn btn-secondary mt-2">Add another answer</button>
+            <a href="answer.php?id=<?= htmlspecialchars($form_id) ?>&edit=<?= htmlspecialchars($answer_data['answer_id']) ?>" class="btn mt-2">Antwort bearbeiten</a>
+            <button onclick="clearAndAnswerNew()" class="btn btn-secondary mt-2">Weitere Antwort hinzufügen</button>
         </div>
     </main>
 </body>