feat: Mehrsprachigkeit EN/FR/ES via Mistral + Sprachumschalter
Quality Gate / 🛡️ Lint + Type Check + Tests (push) Failing after 11m29s

- Übersetzung per ministral-3b-latest (on-demand + DB-Cache)
- Sprachumschalter im Detailseiten-Header (DE/EN/FR/ES)
- ?lang= Query-Parameter auf /beitrag/<id>
- Neue translations-Tabelle mit submission_id+lang UNIQUE
This commit is contained in:
Hermes Agent
2026-07-16 08:04:10 +02:00
parent 5a50df7923
commit 6a55a3e475
2 changed files with 97 additions and 4 deletions
+7 -1
View File
@@ -4486,6 +4486,9 @@ def api_submit():
@app.route("/beitrag/<int:sub_id>")
def public_detail(sub_id: int):
lang = request.args.get("lang", "de")
if lang not in ("de", "en", "fr", "es"):
lang = "de"
"""Public detail view — full media, text, and metadata."""
import base64
db = get_db()
@@ -4558,7 +4561,10 @@ def public_detail(sub_id: int):
except Exception:
pass
content = (row["summary"] or row["content"] or "").strip()
# ── Mehrsprachigkeit ──
translation = get_translated_content(db, sub_id, lang, row)
content = translation["content"]
display_text = translation["display_text"]
# Comments
comment_rows = db.execute(