Add native language support in vocab course management

- Introduced a new field for native language in the VocabCourse model to allow learners to specify their native language.
- Updated the VocabService to handle native language during course creation and retrieval, including filtering options.
- Enhanced the database schema to include foreign key constraints for native language.
- Updated frontend components to support native language selection and display in course listings.
- Added internationalization strings for native language features in both German and English.
This commit is contained in:
Torsten Schulz (local)
2026-01-19 11:43:38 +01:00
parent 714e144329
commit 09e53244d9
8 changed files with 531 additions and 5 deletions

View File

@@ -0,0 +1,24 @@
-- ============================================
-- Füge native_language_id zu vocab_course hinzu
-- ============================================
-- Dieses Feld speichert die Muttersprache des Lerners
-- z.B. "Bisaya für Deutschsprachige" -> language_id = Bisaya, native_language_id = Deutsch
-- Spalte hinzufügen
ALTER TABLE community.vocab_course
ADD COLUMN IF NOT EXISTS native_language_id INTEGER;
-- Foreign Key Constraint hinzufügen
ALTER TABLE community.vocab_course
ADD CONSTRAINT vocab_course_native_language_fk
FOREIGN KEY (native_language_id)
REFERENCES community.vocab_language(id)
ON DELETE SET NULL;
-- Index für bessere Performance
CREATE INDEX IF NOT EXISTS vocab_course_native_language_idx
ON community.vocab_course(native_language_id);
-- Kommentar hinzufügen
COMMENT ON COLUMN community.vocab_course.native_language_id IS
'Muttersprache des Lerners (z.B. Deutsch, Englisch). NULL bedeutet "für alle Sprachen".';