feat: Mehrsprachigkeit EN/FR/ES via Mistral + Sprachumschalter
Quality Gate / 🛡️ Lint + Type Check + Tests (push) Failing after 11m29s
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user