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:
@@ -11,7 +11,7 @@ Lock behaviour (unchanged):
|
||||
- cloud sets locked=true → lock_pending while a workday is open, locked once it closes
|
||||
- expiry past grace / site deactivated → likewise never mid-service
|
||||
"""
|
||||
from core import allergens, sales_points
|
||||
from core import allergens, menu_languages, sales_points
|
||||
from core.access.queries import holders_filter
|
||||
from core.timeutil import utcnow
|
||||
import asyncio
|
||||
@@ -288,11 +288,14 @@ def menu_snapshot(db) -> tuple[dict, list]:
|
||||
"digital_available": bool(p.digital_available),
|
||||
"digital_image_url": p.digital_image_url,
|
||||
"image_url": p.image_url,
|
||||
"quick_options": [{"id": o.id, "name": o.name, "price": o.price} for o in p.quick_options],
|
||||
"quick_options": [{"id": o.id, "name": o.name, "price": o.price,
|
||||
"names": menu_languages.quick_texts(o.name, menu_languages.of(p))} for o in p.quick_options],
|
||||
"allergens": allergens.of(p), # 6.3: {key: "contains" | "may_contain"}
|
||||
**menu_languages.product_texts(p), # 6.4: names / descriptions {language: text}
|
||||
})
|
||||
if product_list:
|
||||
payload_categories.append({"id": cat.id, "name": cat.name, "sort_order": cat.sort_order,
|
||||
"names": menu_languages.texts(cat.name, menu_languages.of(cat), "name"),
|
||||
"products": product_list})
|
||||
# delivery areas and fee rules (S.3): the cloud applies them at checkout with the same
|
||||
# engine (services/fees.py); the venue's time zone says what "22:00" and "Saturday" mean
|
||||
|
||||
Reference in New Issue
Block a user