feat: staff apps show the menu in the reader's language (plan 6R.L)

The waiters' phones and the counter show categories, products and every
choice (quick options, extras and sub-choices, preferences, shared sets,
ingredients, groups) in the signed-in person's language, falling back to
the stored text. Display only: carts, lines, tickets and the kitchen keep
the venue's text (ids, sub-choices by stored name). In the venue's own
language nothing changes.

- @xenia/access: menuText / useMenuText (mt, mt.choice, mt.line, mt.matches)
- /api/pos/menu carries translations for products, categories and choices
- shared ProductDialog takes a text() prop (the counter passes useMenuText)
- search finds a product by its name in any language (counter, waiter)
- waiter: useMenuNames for sent lines; picker, drawer, cart, summary,
  table lines, quantity / price history, favourites setup
- counter: categories, cards, dialog, cart lines, table lines, payment rows
- tests: access menuText, ordering search, test_pos per-language,
  e2e waiter.mjs and terminal.mjs 6R.L blocks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 20:18:10 +02:00
co-authored by Claude Opus 5.5
parent f107deca8c
commit 0840247768
29 changed files with 518 additions and 123 deletions
+12
View File
@@ -21,3 +21,15 @@ test('a product with a preference to pick needs the dialog; the line holds ids o
assert.equal('unit_price' in line, false)
assert.deepEqual(line.removed, [9])
})
test('search: the stored name or its text in any language (6R.L)', async () => {
const { searchProducts } = await import('../src/cart.js')
const list = [
{ id: 1, name: 'Πίτα γύρος', translations: { el: { name: 'Πίτα γύρος' }, en: { name: 'Gyros pita' } } },
{ id: 2, name: 'Freddo', translations: {} },
]
assert.deepEqual(searchProducts(list, 'gyros').map(p => p.id), [1])
assert.deepEqual(searchProducts(list, 'γυρος πιτα').map(p => p.id), [1])
assert.deepEqual(searchProducts(list, 'fred').map(p => p.id), [2])
assert.deepEqual(searchProducts(list, 'gyros fred').map(p => p.id), [])
})