- 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>
12 lines
738 B
JavaScript
12 lines
738 B
JavaScript
// The menu's languages (plan step 6.4, owner 2026-11-18): English and Greek, the same list as the
|
|
// backend's core/menu_languages.py. A product's own name is its base text; a translation adds
|
|
// the other language; a missing translation shows the base text.
|
|
export const MENU_LANGUAGES = ['el', 'en']
|
|
|
|
/** The languages a venue translates its menu into: every menu language but its own. */
|
|
export const translatedLanguages = venueLanguage => MENU_LANGUAGES.filter(l => l !== venueLanguage)
|
|
|
|
/** A product's or category's text in a language: `names` / `descriptions` {lang: text} as the
|
|
* backend resolves them for customer screens, else the base text. */
|
|
export const inLanguage = (texts, lang, base) => (texts && texts[lang]) || base
|