feat(menu): the menu in English and Greek (platform-v2 step 6.4, D-29)

- products.translations / categories.translations (Alembic 0033, core/menu_languages.py: el + en,
  name / description / quick options by their base name; catalog.translation). Empty = the text
  as typed; no machine translation (owner).
- In the manager's product editor ("In English" / "In Greek", quick extras), the category dialog,
  and a menu board's Language (signage MenuContent.language).
- Customer screens only: cloud snapshot names / descriptions per language (C-2), the menu tablet's
  EL / EN switch the names (localize), signage boards; tickets, KDS, counter, phones keep the base.
- Catalogue bundles carry translations; @xenia/access menuLanguages.js (a backend test compares).
- e2e: manager (the other language saved), menu tablet (EN / EL names), QR table (English on
  the menu, the base name on the kitchen's order, Greek page as typed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 10:47:03 +02:00
co-authored by Claude Opus 5.5
parent 5048f82a4c
commit e395d99704
32 changed files with 459 additions and 38 deletions
+4 -3
View File
@@ -26,7 +26,7 @@ import time
from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session
from core import allergens, sales_points
from core import allergens, menu_languages, sales_points
from core.access.deps import require_device
from core.errors import XeniaError
from database import get_db
@@ -112,7 +112,8 @@ def menu(db: Session = Depends(get_db), dev=Depends(require_device("menu_tablet"
ids = in_cat.get(c.id, [])
has_sub = any(in_cat.get(x.id) for x in by_parent.get(c.id, []))
if ids or has_sub:
out_cats.append({"id": c.id, "name": c.name, "parent_id": c.parent_id, "depth": depth, "products": ids})
out_cats.append({"id": c.id, "name": c.name, "names": menu_languages.texts(c.name, menu_languages.of(c), "name"),
"parent_id": c.parent_id, "depth": depth, "products": ids})
used.update(ids)
shown = [by_id[i] for i in by_id if i in used]
prices = dict(zip([p.id for p in shown], unit_prices(db, shown, point))) if point and shown else {}
@@ -124,7 +125,7 @@ def menu(db: Session = Depends(get_db), dev=Depends(require_device("menu_tablet"
"config": cfg,
"categories": out_cats,
"products": {str(p.id): {"id": p.id, "name": p.name, "description": p.description or None, "tags": _tags(p),
"allergens": allergens.of(p),
"allergens": allergens.of(p), **menu_languages.product_texts(p, customer=False),
"price": round(prices[p.id], 2) if p.id in prices else None, "available": bool(p.is_available),
"image": media_store.image_of(p.media)} for p in shown},
}