// Plan step 4.5: the waiter app's texts live in @xenia/i18n (namespace `waiter`, English first, // Greek as a translation). No Greek letter may appear in the app's source: a new text is a key // in packages/i18n/locales/{en,el}/waiter.json. (A Greek word the code must recognise, e.g. in // a server message, is written with \u escapes.) import { test } from 'node:test' import assert from 'node:assert/strict' import { readdirSync, readFileSync, statSync } from 'node:fs' import path from 'node:path' import { fileURLToPath } from 'node:url' const SRC = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'src') const GREEK = /[Ͱ-Ͽἀ-῿]/ function walk(dir, out = []) { for (const name of readdirSync(dir)) { const p = path.join(dir, name) if (statSync(p).isDirectory()) walk(p, out) else if (/\.(jsx?|mjs|css|html)$/.test(name)) out.push(p) } return out } test('no Greek text in the waiter app source (texts are i18n keys)', () => { const hits = [] for (const file of walk(SRC)) { readFileSync(file, 'utf8').split('\n').forEach((line, i) => { if (GREEK.test(line)) hits.push(`${path.relative(SRC, file)}:${i + 1}: ${line.trim().slice(0, 80)}`) }) } assert.deepEqual(hits, [], `Greek text found — make it a key in the waiter namespace:\n${hits.join('\n')}`) })