From 895e12dfb8c6dc7f096535a3ce84679127e6e3ad Mon Sep 17 00:00:00 2001
From: Julian Leucker <leuckerj@gmail.com>
Date: Fri, 16 Feb 2024 19:04:26 +0100
Subject: [PATCH] Translate coursebook

---
 .../documentation/LessonSummary.vue           | 20 +++++++++++++------
 .../apps/alsijil/frontend/messages/de.json    | 17 ++++++++++++++++
 .../apps/alsijil/frontend/messages/en.json    | 19 +++++++++++++++++-
 3 files changed, 49 insertions(+), 7 deletions(-)

diff --git a/aleksis/apps/alsijil/frontend/components/documentation/LessonSummary.vue b/aleksis/apps/alsijil/frontend/components/documentation/LessonSummary.vue
index 8396743b3..c540bdd65 100644
--- a/aleksis/apps/alsijil/frontend/components/documentation/LessonSummary.vue
+++ b/aleksis/apps/alsijil/frontend/components/documentation/LessonSummary.vue
@@ -5,7 +5,7 @@
       dense
       filled
       v-if="compact"
-      label="Thema"
+      :label="$t('alsijil.coursebook.summary.topic')"
       :value="documentation.topic"
       @input="topic=$event"
       @focusout="save"
@@ -16,21 +16,29 @@
       outlined
       @click="$emit('open')"
     >
-      Hausaufgaben: {{ truncate(documentation.homework) }}
+      {{
+        documentation.homework
+            ? $t("alsijil.coursebook.summary.homework.value", {homework: truncate(documentation.homework)})
+            : $t("alsijil.coursebook.summary.homework.empty")
+      }}
     </v-chip>
     <v-chip
       v-if="compact"
       outlined
       @click="$emit('open')"
     >
-      Gruppennotiz: {{ truncate(documentation.groupNote) }}
+      {{
+        documentation.groupNote
+            ? $t("alsijil.coursebook.summary.group_note.value", {groupNote: truncate(documentation.groupNote)})
+            : $t("alsijil.coursebook.summary.group_note.empty")
+      }}
     </v-chip>
     <!-- not compact -->
     <!-- Are focusout & enter enough trigger? -->
     <v-text-field
       filled
       v-if="!compact"
-      label="Thema"
+      :label="$t('alsijil.coursebook.summary.topic')"
       :value="documentation.topic"
       @input="topic=$event"
     />
@@ -38,7 +46,7 @@
       filled
       auto-grow
       v-if="!compact"
-      label="Hausaufgaben"
+      :label="$t('alsijil.coursebook.summary.homework.label')"
       :value="documentation.homework"
       @input="homework=$event"
     />
@@ -46,7 +54,7 @@
       filled
       auto-grow
       v-if="!compact"
-      label="Gruppennotiz"
+      :label="$t('alsijil.coursebook.summary.group_note.label')"
       :value="documentation.groupNote"
       @input="groupNote=$event"
       />
diff --git a/aleksis/apps/alsijil/frontend/messages/de.json b/aleksis/apps/alsijil/frontend/messages/de.json
index 09456c744..0d6f76832 100644
--- a/aleksis/apps/alsijil/frontend/messages/de.json
+++ b/aleksis/apps/alsijil/frontend/messages/de.json
@@ -31,6 +31,23 @@
     },
     "all_lessons": {
       "menu_title": "Alle Stunden"
+    },
+    "coursebook": {
+      "menu_title": "Kursbuch",
+      "page_title": "Kursbuch für {name}",
+      "summary": {
+        "topic": "Thema",
+        "homework": {
+          "label": "Hausaufgaben",
+          "value": "Hausaufgaben: {homework}",
+          "empty": "Keine Hausaufgaben"
+        },
+        "group_note": {
+          "label": "Gruppennotiz",
+          "value": "Gruppennotiz: {groupNote}",
+          "empty": "Keine Gruppennotiz"
+        }
+      }
     }
   }
 }
diff --git a/aleksis/apps/alsijil/frontend/messages/en.json b/aleksis/apps/alsijil/frontend/messages/en.json
index cd9798229..2537974f9 100644
--- a/aleksis/apps/alsijil/frontend/messages/en.json
+++ b/aleksis/apps/alsijil/frontend/messages/en.json
@@ -31,6 +31,23 @@
     "all_lessons": {
       "menu_title": "All lessons"
     },
-    "menu_title": "Class register"
+    "menu_title": "Class register",
+    "coursebook": {
+      "menu_title": "Coursebook",
+      "page_title": "Coursebook for {name}",
+      "summary": {
+        "topic": "Topic",
+        "homework": {
+          "label": "Homework",
+          "value": "Homework: {homework}",
+          "empty": "No homework"
+        },
+        "group_note": {
+          "label": "Group note",
+          "value": "Group note: {groupNote}",
+          "empty": "No group note"
+        }
+      }
+    }
   }
 }
-- 
GitLab