From 84adfeafb4c4b012c30e2c57c3d028e417f1be50 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Wed, 1 Apr 2026 10:22:53 +0200 Subject: [PATCH] feat(vocab): add grammar explanations to VocabLessonView and enhance localization - Introduced new sections for grammar explanations in VocabLessonView, providing users with contextual insights during vocabulary lessons. - Added localization keys in German, English, and Spanish for the new grammar explanation titles and introductions, improving user guidance across languages. - Updated styles for the grammar explanation section to enhance visual clarity and user experience. --- .../src/i18n/locales/de/socialnetwork.json | 2 + .../src/i18n/locales/en/socialnetwork.json | 2 + .../src/i18n/locales/es/socialnetwork.json | 2 + frontend/src/views/social/VocabLessonView.vue | 59 +++++++++++++++++++ 4 files changed, 65 insertions(+) diff --git a/frontend/src/i18n/locales/de/socialnetwork.json b/frontend/src/i18n/locales/de/socialnetwork.json index 7650c9a..b08d17e 100644 --- a/frontend/src/i18n/locales/de/socialnetwork.json +++ b/frontend/src/i18n/locales/de/socialnetwork.json @@ -461,6 +461,8 @@ "learningGoals": "Lernziele", "corePatterns": "Kernmuster", "corePatternsHint": "Zuerst die Zielsprache lesen, darunter die deutsche Bedeutung — so lernst du jedes Muster bewusst in beiden Richtungen.", + "learningGrammarTitle": "Kurz die Grammatik einordnen", + "learningGrammarIntro": "Lies diese 1-2 Hinweise nach den Begriffen kurz durch. Danach gehst du mit mehr Orientierung in den Trainer.", "vocabPrepTitle": "Vorbereitung vor dem Vokabeltrainer", "vocabPrepStep1": "Lies Kernmuster und Wortliste (Deutsch ↔ Zielsprache) einmal in Ruhe durch.", "vocabPrepProgress": "Durchgang {pass}: Begriff {current} von {total}", diff --git a/frontend/src/i18n/locales/en/socialnetwork.json b/frontend/src/i18n/locales/en/socialnetwork.json index 0889701..515dce6 100644 --- a/frontend/src/i18n/locales/en/socialnetwork.json +++ b/frontend/src/i18n/locales/en/socialnetwork.json @@ -461,6 +461,8 @@ "learningGoals": "Learning Goals", "corePatterns": "Core Patterns", "corePatternsHint": "Read the target language first, then the meaning below — you learn each pattern both ways.", + "learningGrammarTitle": "Briefly frame the grammar", + "learningGrammarIntro": "Read these 1-2 hints after the key terms. Then you go into the trainer with better orientation.", "vocabPrepTitle": "Preparation before the vocabulary trainer", "vocabPrepStep1": "Read through core patterns and the word list (native language ↔ target language) once.", "vocabPrepProgress": "Pass {pass}: item {current} of {total}", diff --git a/frontend/src/i18n/locales/es/socialnetwork.json b/frontend/src/i18n/locales/es/socialnetwork.json index 2fbffe5..7ab1fa2 100644 --- a/frontend/src/i18n/locales/es/socialnetwork.json +++ b/frontend/src/i18n/locales/es/socialnetwork.json @@ -459,6 +459,8 @@ "learningGoals": "Objetivos", "corePatterns": "Patrones básicos", "corePatternsHint": "Primero la lengua meta; debajo, el significado en tu idioma.", + "learningGrammarTitle": "Ubicar brevemente la gramática", + "learningGrammarIntro": "Lee estas 1-2 pistas después de los términos clave. Así entras al entrenador con mejor orientación.", "vocabPrepTitle": "Preparación antes del entrenador de vocabulario", "vocabPrepStep1": "Lee una vez los patrones clave y la lista de palabras (idioma nativo ↔ lengua meta).", "vocabPrepProgress": "Pasada {pass}: término {current} de {total}", diff --git a/frontend/src/views/social/VocabLessonView.vue b/frontend/src/views/social/VocabLessonView.vue index 282e4cb..997cee9 100644 --- a/frontend/src/views/social/VocabLessonView.vue +++ b/frontend/src/views/social/VocabLessonView.vue @@ -139,6 +139,25 @@ +
+
+ {{ $t('socialnetwork.vocab.courses.grammarImpulse') }} +

{{ $t('socialnetwork.vocab.courses.learningGrammarTitle') }}

+
+

{{ $t('socialnetwork.vocab.courses.learningGrammarIntro') }}

+
+
+ {{ explanation.title || $t('socialnetwork.vocab.courses.grammarImpulse') }} +

{{ explanation.text }}

+

{{ explanation.example }}

+
+
+
+

{{ $t('socialnetwork.vocab.courses.vocabTrainer') }}

@@ -2793,6 +2812,46 @@ export default { color: #6b5535; } +.lesson-grammar-impulse { + margin-top: 16px; + padding: 16px 18px; + border: 1px solid rgba(121, 100, 56, 0.18); + background: rgba(255, 255, 255, 0.72); +} + +.lesson-grammar-impulse__header { + display: flex; + flex-direction: column; + gap: 8px; + margin-bottom: 10px; +} + +.lesson-grammar-impulse__header h4 { + margin: 0; + color: #3f2d14; +} + +.lesson-grammar-impulse__intro { + margin: 0 0 12px; + color: #6b5535; +} + +.lesson-grammar-impulse__list { + display: grid; + gap: 12px; +} + +.lesson-grammar-impulse__item { + padding: 12px 14px; + border-radius: 10px; + background: rgba(255, 249, 240, 0.88); + border: 1px solid rgba(121, 100, 56, 0.12); +} + +.lesson-grammar-impulse__item p { + margin: 6px 0 0; +} + .vocab-trainer-locked-hint { margin: 0; color: #8a5a00;