diff --git a/frontend/src/views/social/VocabLessonView.vue b/frontend/src/views/social/VocabLessonView.vue index ede4a80..154f5d0 100644 --- a/frontend/src/views/social/VocabLessonView.vue +++ b/frontend/src/views/social/VocabLessonView.vue @@ -1012,6 +1012,8 @@ export default { exerciseSequentialIndex: 0, /** Aus vorherigen Lektionen (MC-Optionen nach Fragentyp Ziel-/Muttersprache) */ distractorPool: { target: [], native: [] }, + courseLanguageName: '', + courseNativeLanguageName: '', /** Fortschritt aller Kurslektionen inkl. lessonState für Spezial-Trainer-Boost */ courseProgressList: [], /** { [exerciseId]: { options: string[], useTextAnswer: boolean } } */ @@ -1297,14 +1299,16 @@ export default { }, prepTargetLabel() { return String( - this.lesson?.course?.languageName + this.courseLanguageName + || this.lesson?.course?.languageName || this.lesson?.languageName || this.$t('socialnetwork.vocab.courses.vocabPrepTargetLabel') ).toUpperCase(); }, prepGlossLabel() { return String( - this.lesson?.course?.nativeLanguageName + this.courseNativeLanguageName + || this.lesson?.course?.nativeLanguageName || this.lesson?.nativeLanguageName || this.$t('socialnetwork.vocab.courses.vocabPrepGlossLabel') ).toUpperCase(); @@ -2133,6 +2137,8 @@ export default { this.vocabTrainerCurrentAttempts = 0; this.vocabTrainerReviewAttempts = 0; this.courseProgressList = []; + this.courseLanguageName = ''; + this.courseNativeLanguageName = ''; this.distractorPool = { target: [], native: [] }; this.mcRandomizedOptions = {}; // Reset Flags @@ -2154,6 +2160,7 @@ export default { try { const res = await apiClient.get(`/api/vocab/lessons/${this.lessonId}`); this.lesson = res.data; + await this.loadCourseLanguageNames(); await this.loadCourseProgressForBoost(); debugLog('[VocabLessonView] Geladene Lektion:', this.lesson?.id, this.lesson?.title); if (this.$route.query.assistant) { @@ -2199,6 +2206,16 @@ export default { this.courseProgressList = []; } }, + async loadCourseLanguageNames() { + try { + const { data } = await apiClient.get(`/api/vocab/courses/${this.courseId}`); + this.courseLanguageName = String(data?.languageName || '').trim(); + this.courseNativeLanguageName = String(data?.nativeLanguageName || '').trim(); + } catch (e) { + this.courseLanguageName = ''; + this.courseNativeLanguageName = ''; + } + }, focusAssistantCard() { const target = this.$refs.assistantCard; if (!target || typeof target.scrollIntoView !== 'function') {