Skip to content

feat: add Punjabi (pa) locale support - #1489

Merged
khaira777 merged 6 commits into
mainfrom
fm/flocafe-i18n-punjabi
Nov 7, 2026
Merged

khaira777 merged 6 commits into
mainfrom
fm/flocafe-i18n-punjabi

Conversation

@khaira777

@khaira777 khaira777 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Implement full Punjabi (pa, pa-IN, ਪੰਜਾਬੀ) language support across the entire FloCafe application, including the main POS app, KDS, Server App, Customer Display, Setup, Settings, thermal print/KOT labels, WhatsApp plain-text reports, and sample seed data.

Fixes #1476

What Changed

  • Added full Punjabi (pa, pa-IN, ਪੰਜਾਬੀ) localization across the POS, KDS, Server App, Customer Display, Setup, and Settings via frontend/src/lib/i18n/languages.ts, frontend/src/lib/i18n/messages/pa.json, generated thermal print/KOT labels (main/print/print-labels.generated.ts), startup/shutdown status messages (main/status-messages.ts), and localized sample/express seed data (main/setup/seed-data.ts).
  • Extended UI, browser receipt/KOT/slip print, raster canvas, and HTML report export font stacks with Gurmukhi typefaces (Noto Sans Gurmukhi, Raavi, Kohinoor Gurmukhi, Gurmukhi Sangam MN), and updated shared/print/width.ts and shared/print/raster-canvas.ts to keep Indic virama conjunct clusters (including Gurmukhi U+0A4D) together during grapheme segmentation and line wrapping.
  • Added FLO_ORDER_READ_RATE_LIMIT_MAX support in main/routes/orders.ts (wired in tests/e2e-server.cjs) and updated unit, print, RTL/locale, WhatsApp report, and E2E test suites and documentation for the 25 supported languages.

Risk Assessment

✅ Low: The Punjabi (pa / pa-IN) locale addition, Gurmukhi font fallbacks, Indic virama conjunct segmentation in both width.ts and raster-canvas.ts, seed data, and E2E rate-limit configuration are well-bounded and consistent with existing locale implementations.

Testing

Built the backend and static frontend and ran targeted verification across translation integrity (npm run i18n:check, npm run docs:check), thermal/browser printing (test:print-labels, test:print-kernel, test:browser-receipts, test:raster, test:receipt-column-width, test:receipt-column-oracle), locale decoupling and RTL/LTR layout guards (test:decoupled-ui-locale, test:i18n-audit-remediations, test:rtl-*), database demo seeding (test:phase7-setup-i18n), WhatsApp reports and exports (test:cash-closures, test:daily-sales-export, test:daily-invoices-export), Electron status messages (test:status-messages), and live Chromium Playwright E2E specs (phase7-setup-print-i18n.spec.ts and server-app-ordering.spec.ts), confirming all 12 visual and JSON evidence artifacts in the evidence directory.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Merchant selects Punjabi (ਪੰਜਾਬੀ / pa) in the first-run Setup wizard and seeds the sample restaurant catalog with Gurmukhi categories, products, and customers ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/01_punjabi_setup_wizard.png, ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/02_punjabi_seeded_catalog.jso…
Staff uses the main POS, Orders, and Settings screens in Punjabi (pa-IN, LTR) with localized navigation, cart controls, and order actions ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/03_punjabi_pos_cart.png, ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/04_punjabi_settings.png, ~
Standalone KDS, Standalone Server App, and Customer Display sync and render Punjabi (pa-IN) UI labels and order status headers ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/06_punjabi_kds_standalone.png, ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/07_punjabi_server_app.png,…
Browser web-print receipts, tableside order slips, KOTs, delivery slips, and the Print Test page render Punjabi (pa-IN) Gurmukhi labels and font fallbacks ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/05_punjabi_print_test.png, ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/09_punjabi_browser_receipt.png,…
Adversarial Gurmukhi conjuncts (U+0A4D virama + consonant like ਪ੍ਰ in ਹਰਪ੍ਰੀਤ) and trailing virama before punctuation/spaces segment and wrap without splitting clusters or overflowing thermal columns ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/12_punjabi_whatsapp_and_gurmukhi_width.json, npm run test:print-kernel, npm run test:raster, npm run test:receipt-column-oracle
WhatsApp plain-text Z-reports, CSV export filename slugs, and Electron startup/shutdown status messages localize cleanly in Punjabi (pa) ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/12_punjabi_whatsapp_and_gurmukhi_width.json, npm run test:cash-closures, npm run test:daily-sales-export, npm run test:daily-invo…

Punjabi Setup Wizard (pa, ਪੰਜਾਬੀ)

Evidence: Seeded Punjabi Demo Catalog JSON (`main/setup/seed-data.ts`)
{
  "store_name": "ਫਲੋ ਕੈਫ਼ੇ ਅੰਮ੍ਰਿਤਸਰ",
  "categories": [
    {
      "id": "cat-demo-starters",
      "name": "ਸਟਾਰਟਰ"
    },
    {
      "id": "cat-demo-main",
      "name": "ਮੁੱਖ ਪਕਵਾਨ"
    },
    {
      "id": "cat-demo-beverages",
      "name": "ਪੀਣ ਵਾਲੇ ਪਦਾਰਥ"
    },
    {
      "id": "cat-demo-desserts",
      "name": "ਮਿਠਾਈਆਂ"
    }
  ],
  "products": [
    {
      "id": "prod-demo-cola",
      "name": "ਕੋਲਾ",
      "price": 60
    },
    {
      "id": "prod-demo-gulab-jamun",
      "name": "ਗੁਲਾਬ ਜਾਮੁਨ",
      "price": 80
    },
    {
      "id": "prod-demo-chicken-wings",
      "name": "ਚਿਕਨ ਵਿੰਗਜ਼",
      "price": 280
    },
    {
      "id": "prod-demo-jeera-rice",
      "name": "ਜ਼ੀਰਾ ਚੌਲ",
      "price": 150
    },
    {
      "id": "prod-demo-dal-makhani",
      "name": "ਦਾਲ ਮੱਖਣੀ",
      "price": 220
    },
    {
      "id": "prod-demo-lemon-soda",
      "name": "ਨਿੰਬੂ ਸੋਡਾ",
      "price": 70
    },
    {
      "id": "prod-demo-paneer-tikka",
      "name": "ਪਨੀਰ ਟਿੱਕਾ",
      "price": 250
    },
    {
      "id": "prod-demo-butter-chicken",
      "name": "ਬਟਰ ਚਿਕਨ",
      "price": 320
    }
  ],
  "tables": [],
  "customers": [
    {
      "id": "cust-demo-1",
      "name": "ਹਰਪ੍ਰੀਤ ਸਿੰਘ",
      "phone": "+919876543210"
    },
    {
      "id": "cust-demo-2",
      "name": "ਸਿਮਰਨ ਕੌਰ",
      "phone": "+919876543211"
    },
    {
      "id": "cust-demo-3",
      "name": "ਗੁਰਪ੍ਰੀਤ ਗਿੱਲ",
      "phone": "+919876543212"
    }
  ]
}
![Main POS Screen & Cart in Punjabi (`pa-IN`)](https://github.com/user-attachments/assets/9d71bde9-c3b1-4ebd-acfb-257363e21267) ![Settings Screen in Punjabi (`pa-IN`)](https://github.com/user-attachments/assets/157702a8-e110-4b42-a88e-a181182a332c) ![Print Test Page in Punjabi (`pa-IN`)](https://github.com/user-attachments/assets/000e0fde-c1e9-426b-99e3-e69ba78fe1a9) ![Standalone KDS Login in Punjabi (`pa-IN`)](https://github.com/user-attachments/assets/aabb3881-edd2-4bc1-914b-5513675dada9) ![Standalone Server App Login in Punjabi (`pa-IN`)](https://github.com/user-attachments/assets/7ee32141-0e7c-4581-b83c-44703ba386b1) ![Customer Display Screen in Punjabi (`pa-IN`)](https://github.com/user-attachments/assets/66b514b7-7238-4d81-af9a-7ff0a1c5f0fe) ![Browser Web-Print Receipt in Punjabi (`pa-IN`)](https://github.com/user-attachments/assets/0ceff630-e95f-4d08-a05d-651e0a8c9639) ![Tableside Order Slip in Punjabi (`pa-IN`)](https://github.com/user-attachments/assets/154b6a4c-9835-4e81-8665-e7574de41c30) ![Orders Screen & Takeaway Conversion Menu in Punjabi (`pa-IN`)](https://github.com/user-attachments/assets/93f3af9d-d712-4b57-a349-6b5a80f3c4bf)
Evidence: WhatsApp Z-Report, Gurmukhi Width/Raster Conjuncts, and Status Messages JSON
{
  "whatsappReportPreview": "📊 *Z ਰਿਪੋਰਟ #12 - ਫਲੋ ਕੈਫ਼ੇ ਅੰਮ੍ਰਿਤਸਰ*\n📅 *ਕਾਰੋਬਾਰੀ ਮਿਤੀ:* 2026 M11 7 (2026-11-07 09:00 AM - 2026-11-07 10:00 PM)\n👤 *ਬੰਦ ਕਰਨ ਵਾਲਾ:* ਹਰਪ੍ਰੀਤ ਸਿੰਘ\n\n💰 *ਵਿਕਰੀ ਸਾਰ*\n• ਕੁੱਲ ਉਗਰਾਹੀ: ₹ 14,500.00\n• ਰਿਫੰਡ: ₹ 200.00\n• ਸ਼ੁੱਧ ਉਗਰਾਹੀ: ₹ 14,300.00\n• 28 ਬਿੱਲ\n\n💳 *ਭੁਗਤਾਨ*\n• ਨਕਦ: ₹ 8,500.00 (18)\n• ਕਾਰਡ: ₹ 5,800.00 (10)\n\n💵 *ਨਕਦ ਦਰਾਜ਼ ਮਿਲਾਨ*\n• ਸ਼ੁਰੂਆਤੀ ਨਕਦ: ₹ 2,000.00\n• ਅਨੁਮਾਨਿਤ ਨਕਦ: ₹ 10,500.00\n• ਗਿਣਿਆ ਗਿਆ ਨਕਦ: ₹ 10,500.00\n• ਫ਼ਰਕ: ₹ 0.00 (✅ ਬਿਲਕੁਲ ਸਹੀ)\n\n📝 *ਨੋਟਸ:* ਸ਼ਿਫਟ ਸਹੀ ਤਰ੍ਹਾਂ ਬੰਦ ਹੋਈ",
  "gurmukhiSegmentation": {
    "conjunctPre": {
      "input": "ਪ੍ਰ",
      "segments": [
        "ਪ੍ਰ"
      ],
      "displayCells": 1
    },
    "trailingViramaPunctuation": {
      "input": "ਕ੍!",
      "segments": [
        "ਕ੍",
        "!"
      ],
      "displayCells": 2
    },
    "trailingViramaSpace": {
      "input": "ਕ੍ ਖ",
      "segments": [
        "ਕ੍",
        " ",
        "ਖ"
      ],
      "displayCells": 3
    },
    "rasterCanvasConjunctWrap": {
      "input": "ਹਰਪ੍ਰੀਤ",
      "widthDots": 50,
      "paintedLines": [
        "ਹਰ",
        "ਪ੍ਰੀਤ"
      ]
    }
  },
  "statusMessagesPa": {
    "resolvedLanguage": "pa",
    "starting": [
      "Flo ਸ਼ੁਰੂ ਹੋ ਰਿਹਾ ਹੈ",
      "ਸਭ ਕੁਝ ਤਿਆਰ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ…"
    ],
    "closing": [
      "Flo ਬੰਦ ਹੋ ਰਿਹਾ ਹੈ",
      "ਤੁਹਾਡਾ ਡਾਟਾ ਸੰਭਾਲਿਆ ਜਾ ਰਿਹਾ ਹੈ। ਕਿਰਪਾ ਕਰਕੇ ਕੰਪਿਊਟਰ ਬੰਦ ਨਾ ਕਰੋ।"
    ]
  }
}
- Outcome: 🔧 1 issue found → no changes applied (2) ✅ across 6 runs (2h13m39s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 0 issues

✅ No issues found.

  • ⚠️ shared/print/raster-canvas.ts:71 - paintRasterRequest's self-contained graphemes helper (shared/print/raster-canvas.ts:70-72) returns Array.from(segmenter.segment(value), (part) => part.segment) directly without merging Indic virama (U+094D, U+09CD, U+0A4D) + Indic consonant pairs. In Node 22 / Chromium (Unicode 15.1), Intl.Segmenter does not treat Gurmukhi virama U+0A4D (੍) as an InCB=Linker, so it splits Gurmukhi virama conjuncts into separate segments (for example 'ਪ੍ਰਾਪਤ' -> ['ਪ੍', 'ਰਾ', 'ਪ', 'ਤ'] and 'ਹਰਪ੍ਰੀਤ' -> ['ਹ', 'ਰ', 'ਪ੍', 'ਰੀ', 'ਤ']). Commit 22386bf5 added a post-pass in shared/print/width.ts:126-148 (graphemeSegments) to merge adjacent segments when the previous segment ends with an Indic virama and the next starts with an Indic consonant, but left the sibling graphemes helper in shared/print/raster-canvas.ts:70-72 unpatched (used by wrap at shared/print/raster-canvas.ts:73-87 and called at lines 168, 208, and 221). When wrap wraps a Gurmukhi thermal raster line containing a virama conjunct (such as ਹਰਪ੍ਰੀਤ ਸਿੰਘ, ਪ੍ਰਾਪਤ ਨਕਦ, or ਮੁੜ-ਪ੍ਰਿੰਟ) and the pixel width boundary lands after 'ਪ੍', wrap splits the conjunct across two lines ('…ਪ੍' on line 1 with a visible halant and 'ਰੀ…' on line 2), violating the conjunct-grapheme invariant in docs/reference/translation-terminology.md:30-32. Apply the same self-contained Indic virama + consonant merge inside graphemes in shared/print/raster-canvas.ts:70-72.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ No issues found.

✅ No issues found.

🔧 **Test** - 1 issue found → no changes applied (2) ✅
  • ⚠️ The Test agent did not finish within its invocation budget. Reported: agent run tests timed out after 30m0s: agent last produced output 3s ago (251 observed); agent reported: antigravity parse events: context deadline exceeded. This is a budget or provider-slowness cut, not a code failure. Re-running the same request costs another full budget, so no further attempt is made automatically. If this repository's targeted tests or evidence gathering routinely approach the default 30m0s, raise test_agent_timeout in global config. Respond with fix to spend another budget: a repair turn runs only for selected findings other than this budget cut, then validation re-runs. Or abort and retry after raising the budget.

🔧 No changes applied.
1 warning still open:

  • ⚠️ The Test agent did not finish within its invocation budget. Reported: agent run tests timed out after 30m0s: agent last produced output 853ms ago (354 observed); agent reported: antigravity parse events: context deadline exceeded. This is a budget or provider-slowness cut, not a code failure. Re-running the same request costs another full budget, so no further attempt is made automatically. If this repository's targeted tests or evidence gathering routinely approach the default 30m0s, raise test_agent_timeout in global config. Respond with fix to spend another budget: a repair turn runs only for selected findings other than this budget cut, then validation re-runs. Or abort and retry after raising the budget.

  • ⚠️ The Test agent did not finish within its invocation budget. Reported: agent run tests timed out after 30m0s: agent last produced output 902ms ago (312 observed); agent reported: antigravity parse events: context deadline exceeded. This is a budget or provider-slowness cut, not a code failure. Re-running the same request costs another full budget, so no further attempt is made automatically. If this repository's targeted tests or evidence gathering routinely approach the default 30m0s, raise test_agent_timeout in global config. Respond with fix to spend another budget: a repair turn runs only for selected findings other than this budget cut, then validation re-runs. Or abort and retry after raising the budget.

🔧 No changes applied.
✅ Re-checked - no issues remain.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Merchant selects Punjabi (pa / ਪੰਜਾਬੀ) in the Setup Wizard and initializes a demo store (POST /api/auth/setup/initialize), seeding Gurmukhi categories, menu items, and E.164 customer records ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/01_punjabi_setup_wizard.png, ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/02_punjabi_seeded_catalog.jso…
Cashier and owner use the Main POS app, Settings, Print Test page, and Orders takeaway conversion in Punjabi (pa-IN, LTR) with Gurmukhi navigation, cart controls, and print-test labels ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/03_punjabi_pos_cart.png, ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/04_punjabi_settings.png, ~
Kitchen staff, servers, and guests view the standalone KDS (:3002), standalone Server App (:3003), and Customer Display (/customer-display) in Punjabi without mobile viewport overflow ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/06_punjabi_kds_standalone.png, ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/07_punjabi_server_app.png,…
Browser receipts, tableside order slips, KOTs, and thermal receipts render in Punjabi (lang="pa-IN" dir="ltr") with Gurmukhi font stack and intact Gurmukhi virama conjunct clusters (ਪ੍ਰ, ਹਰਪ੍ਰੀਤ… ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/09_punjabi_browser_receipt.png, ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/10_punjabi_order_slip.png,…
WhatsApp cash-close/daily-sales plain-text reports and Electron lifecycle status messages localize to Punjabi, while adversarial trailing Gurmukhi virama before punctuation/whitespace (ਕ੍!, ਕ੍ ਖ)… ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/12_punjabi_whatsapp_and_gurmukhi_width.json, tests/reports-whatsapp.test.ts, tests/print-kernel.test.ts, tests/decoupled-ui-local…
  • npm run i18n:check
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/translations.test.ts
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/print-labels.test.ts
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/print-kernel.test.ts
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/browser-receipts.test.ts
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/phase3-print-regressions.test.ts
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/phase7-setup-i18n.test.ts
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/decoupled-ui-locale.test.ts
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/i18n-audit-remediations.test.ts
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/reports-whatsapp.test.ts
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/rtl-dashboard-pos-common.test.ts
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/rtl-kds-server-whatsapp.test.ts
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/rtl-setup-auth-settings.test.ts
  • cd frontend && npx playwright test e2e/phase7-setup-print-i18n.spec.ts -g "print-test visible labels use the selected UI locale"
  • cd frontend && npx playwright test e2e/server-app-ordering.spec.ts -g "sends the order note|fits mobile viewports without horizontal overflow"

✅ No issues found.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Merchant selects Punjabi (pa / ਪੰਜਾਬੀ) during first-run setup with demo sample data enabled; Setup Wizard UI renders in Punjabi and persists localized Gurmukhi categories, products, and sample custome… ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/01_punjabi_setup_wizard.png; ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/02_punjabi_seeded_catalog.jso…
Cashier logs into the main POS app in Punjabi, adds seeded Punjabi menu items (ਪਨੀਰ ਟਿੱਕਾ, ਬਟਰ ਚਿਕਨ) to the cart, triggers the takeaway confirmation prompt, and navigates Settings in Punjabi ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/03_punjabi_pos_cart.png; ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/04_punjabi_settings.png; ~
Staff opens Print-Test and browser receipt/order-slip previews in Punjabi; action buttons (ਮੁੱਢਲੀ ਰਸੀਦ (ਥਰਮਲ), ਵੈੱਬ ਪ੍ਰਿੰਟ (ਬ੍ਰਾਊਜ਼ਰ), WhatsApp ਸ਼ੇਅਰ) and thermal/browser receipt labels render in Gurm… ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/05_punjabi_print_test.png; ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/09_punjabi_browser_receipt.png;…
Kitchen staff, servers, and guests view the standalone KDS (:3002), standalone Server App (:3003), and Customer Display in Punjabi; each surface syncs and renders Punjabi UI copy and Gurmukhi order it… ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/06_punjabi_kds_standalone.png; ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/07_punjabi_server_app.png;…
Adversarial Gurmukhi virama conjuncts (ਪ੍ਰ, ਹਰਪ੍ਰੀਤ) and trailing virama before punctuation/space (ਕ੍!, ਕ੍ ਖ) are segmented and wrapped in thermal/raster printing without splitting conjunct clusters o… ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/12_punjabi_whatsapp_and_gurmukhi_width.json; ./node_modules/.bin/ts-node --transpile-only -P tests/tsconfig.json tests/print-kern…
  • npm run i18n:check
  • node tests/run-electron-node-test.cjs tests/phase7-setup-i18n.test.ts
  • node tests/run-electron-node-test.cjs tests/reports-whatsapp.test.ts
  • ./node_modules/.bin/ts-node --transpile-only -P tests/tsconfig.json tests/print-kernel.test.ts
  • ./node_modules/.bin/ts-node --transpile-only -P tests/tsconfig.json tests/print-labels.test.ts
  • ./node_modules/.bin/ts-node --transpile-only -P tests/tsconfig.json tests/browser-receipts.test.ts
  • ./node_modules/.bin/ts-node --transpile-only -P tests/tsconfig.json tests/phase3-print-regressions.test.ts
  • ./node_modules/.bin/ts-node --transpile-only -P tests/tsconfig.json tests/decoupled-ui-locale.test.ts
  • ./node_modules/.bin/ts-node --transpile-only -P tests/tsconfig.json tests/i18n-audit-remediations.test.ts
  • ./node_modules/.bin/ts-node --transpile-only -P tests/tsconfig.json tests/rtl-setup-auth-settings.test.ts
  • ./node_modules/.bin/ts-node --transpile-only -P tests/tsconfig.json tests/rtl-dashboard-pos-common.test.ts
  • ./node_modules/.bin/ts-node --transpile-only -P tests/tsconfig.json tests/rtl-kds-server-whatsapp.test.ts
  • ./node_modules/.bin/ts-node --transpile-only -P tests/tsconfig.json tests/status-messages.test.ts
  • ./node_modules/.bin/electron --no-sandbox tests/raster-renderer-electron.test.cjs
  • node tests/run-electron-node-test.cjs tests/daily-sales-export.test.ts
  • node tests/run-electron-node-test.cjs tests/daily-invoices-export.test.ts
  • node tests/run-electron-node-test.cjs tests/order-write-rate-limits.test.ts
  • cd frontend && npx playwright test e2e/phase7-setup-print-i18n.spec.ts --config=playwright.config.ts --project=chromium

✅ No issues found.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Merchant selects Punjabi (ਪੰਜਾਬੀ / pa) in the first-run Setup wizard and seeds the sample restaurant catalog with Gurmukhi categories, products, and customers ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/01_punjabi_setup_wizard.png, ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/02_punjabi_seeded_catalog.jso…
Staff uses the main POS, Orders, and Settings screens in Punjabi (pa-IN, LTR) with localized navigation, cart controls, and order actions ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/03_punjabi_pos_cart.png, ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/04_punjabi_settings.png, ~
Standalone KDS, Standalone Server App, and Customer Display sync and render Punjabi (pa-IN) UI labels and order status headers ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/06_punjabi_kds_standalone.png, ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/07_punjabi_server_app.png,…
Browser web-print receipts, tableside order slips, KOTs, delivery slips, and the Print Test page render Punjabi (pa-IN) Gurmukhi labels and font fallbacks ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/05_punjabi_print_test.png, ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/09_punjabi_browser_receipt.png,…
Adversarial Gurmukhi conjuncts (U+0A4D virama + consonant like ਪ੍ਰ in ਹਰਪ੍ਰੀਤ) and trailing virama before punctuation/spaces segment and wrap without splitting clusters or overflowing thermal columns ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/12_punjabi_whatsapp_and_gurmukhi_width.json, npm run test:print-kernel, npm run test:raster, npm run test:receipt-column-oracle
WhatsApp plain-text Z-reports, CSV export filename slugs, and Electron startup/shutdown status messages localize cleanly in Punjabi (pa) ✅ pass live ~/.no-mistakes/evidence/01M6T62VXAWK1CFHCWSB9FD7Q7/12_punjabi_whatsapp_and_gurmukhi_width.json, npm run test:cash-closures, npm run test:daily-sales-export, npm run test:daily-invo…
  • npm run i18n:check
  • npm run docs:check
  • npm run test:translations
  • npm run test:print-labels
  • npm run test:print-kernel
  • npm run test:browser-receipts
  • npm run test:decoupled-ui-locale
  • npm run test:i18n-audit-remediations
  • npm run test:phase7-setup-i18n
  • npm run test:rtl-setup-auth-settings
  • npm run test:rtl-dashboard-pos-common
  • npm run test:rtl-kds-server-whatsapp
  • npm run test:status-messages
  • npm run test:raster
  • npm run test:receipt-column-width
  • npm run test:receipt-column-oracle
  • npm run test:daily-sales-export
  • npm run test:daily-invoices-export
  • npm run test:cash-closures
  • cd frontend && npx playwright test phase7-setup-print-i18n.spec.ts server-app-ordering.spec.ts --config=playwright.config.ts --project=chromium
✅ **Document** - passed

✅ No issues found.

✅ No issues found.

✅ No issues found.

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ No issues found.

✅ No issues found.

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

✅ No issues found.

✅ No issues found.

✅ No issues found.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add Punjabi locale support across FloCafe

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Add Punjabi translations for the UI, desktop status messages, print labels, and setup seed data.
• Add Gurmukhi font fallbacks and preserve conjuncts in thermal text layout.
• Extend locale, printing, setup, and RTL/LTR tests; document the new language.
Diagram

graph TD
  Registry["Locale registry"] --> Catalog["Punjabi catalogue"] --> UI["Product UI"] --> Print["Print renderers"]
  Registry --> Seeds["Setup seeds"]
  Catalog --> Labels["Generated labels"] --> Print
  Width["Grapheme layout"] --> Print
Loading
High-Level Assessment

Follow the existing registry, catalogue, generated-label, and print-rendering conventions as this PR does. A separate Punjabi-specific rendering pipeline would duplicate shared behavior; extending the shared grapheme helper and font stacks keeps the change consistent with other locales.

Files changed (35) +9145 / -1777

Enhancement (16) +5311 / -517
globals.cssAdd Gurmukhi UI font fallbacks +1/-1

Add Gurmukhi UI font fallbacks

• Extends the global sans-serif stack with Gurmukhi-capable fonts.

frontend/src/app/globals.css

languages.tsRegister selectable Punjabi locale +7/-0

Register selectable Punjabi locale

• Declares pa with pa-IN, its native name, LTR direction, and a lazy-loaded message catalogue.

frontend/src/lib/i18n/languages.ts

pa.jsonAdd Punjabi UI message catalogue +3601/-0

Add Punjabi UI message catalogue

• Provides Gurmukhi translations across the application's message namespaces, including setup, POS, KDS, Server App, display, printing, and reporting.

frontend/src/lib/i18n/messages/pa.json

PrinterService.tsSupport Gurmukhi in browser print styling +1/-1

Support Gurmukhi in browser print styling

• Adds Gurmukhi fallback fonts to the printer service's generated document styles.

frontend/src/lib/printer/PrinterService.ts

delivery-slip-web-print.tsRender Gurmukhi delivery slips +1/-1

Render Gurmukhi delivery slips

• Adds Gurmukhi fallback fonts to delivery-slip HTML.

frontend/src/lib/printer/delivery-slip-web-print.ts

kot-web-print.tsAdd a Gurmukhi KOT font stack +1/-0

Add a Gurmukhi KOT font stack

• Defines a Guru-script stack for browser-rendered kitchen order tickets.

frontend/src/lib/printer/kot-web-print.ts

order-slip-web-print.tsRender Gurmukhi order slips +1/-1

Render Gurmukhi order slips

• Adds Gurmukhi fallback fonts to order-slip HTML.

frontend/src/lib/printer/order-slip-web-print.ts

web-print.tsRender Gurmukhi browser receipts +1/-1

Render Gurmukhi browser receipts

• Extends browser-print paper styles with Gurmukhi font fallbacks.

frontend/src/lib/printer/web-print.ts

print-labels.generated.tsGenerate Punjabi main-process print labels +148/-0

Generate Punjabi main-process print labels

• Registers pa and adds localized receipt, KOT, delivery-slip, Z-report, and report-sharing labels.

main/print/print-labels.generated.ts

cash-close-export.tsSupport Gurmukhi cash-close exports +1/-1

Support Gurmukhi cash-close exports

• Adds Gurmukhi fallback fonts to the export's HTML styles.

main/services/cash-close-export.ts

daily-invoices-export.tsSupport Gurmukhi invoice reports +1/-0

Support Gurmukhi invoice reports

• Adds Noto Sans Gurmukhi to the report font stack.

main/services/daily-invoices-export.ts

daily-sales-export.tsSupport Gurmukhi daily-sales exports +1/-1

Support Gurmukhi daily-sales exports

• Adds Gurmukhi fallback fonts to daily-sales export HTML.

main/services/daily-sales-export.ts

seed-data.tsLocalize Punjabi sample restaurants +1460/-460

Localize Punjabi sample restaurants

• Adds pa to supported seed languages and supplies Punjabi express and demo catalogue, customer, and staff names. Much of the remaining diff formats existing seed expressions.

main/setup/seed-data.ts

status-messages.tsLocalize desktop lifecycle messages +10/-0

Localize desktop lifecycle messages

• Adds Punjabi title and detail pairs for startup, service initialization, backup, and shutdown states.

main/status-messages.ts

raster-canvas.tsSupport Gurmukhi thermal raster text +1/-1

Support Gurmukhi thermal raster text

• Extends the canvas font fallback stack for rasterized thermal printing.

shared/print/raster-canvas.ts

width.tsKeep Gurmukhi conjuncts intact in print layout +75/-49

Keep Gurmukhi conjuncts intact in print layout

• Recognizes U+0A4D in fallback segmentation and merges virama-linked segments when Intl.Segmenter splits them. Other edits format existing width logic.

shared/print/width.ts

Tests (12) +3802 / -1239
phase7-setup-print-i18n.spec.tsCover Punjabi print-test controls in E2E checks +65/-13

Cover Punjabi print-test controls in E2E checks

• Adds Punjabi button text to the locale-by-locale print-test assertions; also formats existing entries.

frontend/e2e/phase7-setup-print-i18n.spec.ts

browser-receipts.test.tsExercise Punjabi browser receipts +768/-442

Exercise Punjabi browser receipts

• Adds Punjabi to receipt locale coverage and associated rendering assertions; reformats existing fixtures and checks.

tests/browser-receipts.test.ts

decoupled-ui-locale.test.tsCheck Punjabi UI locale against tenant settings +264/-51

Check Punjabi UI locale against tenant settings

• Adds Punjabi receipt and formatting coverage while retaining the separation between UI language and tenant regional settings.

tests/decoupled-ui-locale.test.ts

i18n-audit-remediations.test.tsInclude Punjabi in locale audit checks +221/-68

Include Punjabi in locale audit checks

• Adds pa-IN/LTR expectations, message parity coverage, and a Punjabi web-print bill case.

tests/i18n-audit-remediations.test.ts

phase3-print-regressions.test.tsExtend print regressions to Punjabi +754/-258

Extend print regressions to Punjabi

• Includes pa in print locale coverage and checks Punjabi browser KOT language and direction alongside other print behavior.

tests/phase3-print-regressions.test.ts

phase7-setup-i18n.test.tsVerify localized Punjabi setup seeds +474/-109

Verify localized Punjabi setup seeds

• Extends seed-data checks to Punjabi express and demo restaurant records, including script and sample-data expectations.

tests/phase7-setup-i18n.test.ts

print-kernel.test.tsTest Gurmukhi thermal grapheme layout +294/-108

Test Gurmukhi thermal grapheme layout

• Adds Punjabi matra, conjunct, display-width, wrapping, truncation, and fallback-segmentation coverage.

tests/print-kernel.test.ts

print-labels.test.tsVerify Punjabi financial print labels +364/-82

Verify Punjabi financial print labels

• Asserts Punjabi totals, bill and test labels, and distinct takeaway, delivery, and subtotal terminology.

tests/print-labels.test.ts

rtl-dashboard-pos-common.test.tsAssert Punjabi uses LTR dashboard behavior +2/-0

Assert Punjabi uses LTR dashboard behavior

• Adds pa to LTR toaster-rendering and language-direction checks.

tests/rtl-dashboard-pos-common.test.ts

rtl-kds-server-whatsapp.test.tsCover Punjabi in secondary app locale checks +212/-50

Cover Punjabi in secondary app locale checks

• Adds pa to KDS, Server App, and WhatsApp language and direction test lists.

tests/rtl-kds-server-whatsapp.test.ts

rtl-setup-auth-settings.test.tsTest Punjabi detection and LTR setup +251/-58

Test Punjabi detection and LTR setup

• Checks browser-language detection for pa, pa-IN, and pa-Guru-IN and includes Punjabi in setup, authentication, and settings direction coverage.

tests/rtl-setup-auth-settings.test.ts

translations.test.tsValidate Punjabi translation completeness +133/-0

Validate Punjabi translation completeness

• Adds intentional-identical exceptions and checks for untranslated placeholders, NFC, replacement characters, and consistent Punjabi terminology, with negative validator tests.

tests/translations.test.ts

Documentation (7) +32 / -21
CONTRIBUTING.mdList Punjabi among supported translations +1/-1

List Punjabi among supported translations

• Adds Punjabi to the contributor-facing language list.

CONTRIBUTING.md

README.mdAdvertise Punjabi UI support +1/-0

Advertise Punjabi UI support

• Adds Punjabi to the README's supported-language list.

README.md

frontend.mdUpdate frontend locale counts +3/-3

Update frontend locale counts

• Changes the documented registry and message-file counts to 25 locales.

docs/architecture/frontend.md

internationalization.mdDocument the Punjabi catalogue +3/-3

Document the Punjabi catalogue

• Updates the supported-locale count and catalogue inventory to include pa.

docs/architecture/internationalization.md

printing.mdDocument Gurmukhi virama handling +1/-1

Document Gurmukhi virama handling

• Adds U+0A4D to the printing guide's protected Indic virama list.

docs/architecture/printing.md

adding-a-language.mdRefresh language-addition guidance +12/-9

Refresh language-addition guidance

• Documents status-message registration, Punjabi NFC validation, and current test coverage and locale counts.

docs/guides/adding-a-language.md

translation-terminology.mdRecord Punjabi terminology and conjunct rules +11/-4

Record Punjabi terminology and conjunct rules

• Documents reviewed POS and financial terms, NFC requirements, and Gurmukhi grapheme behavior.

docs/reference/translation-terminology.md

@qodo-code-review

qodo-code-review Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Cashiers see a garbled table prompt 🐞 Bug ≡ Correctness
Description
orders.convertToTakeawayConfirm places ਵਿੱਚ (“into”) after {tableNote}, although that
placeholder can contain the separate instruction to free a table. When a table is attached to the
order, the confirmation asks whether to convert the order into “takeaway and free table X” rather
than clearly confirming both actions.
Code

frontend/src/lib/i18n/messages/pa.json[675]

+    "convertToTakeawayConfirm": "ਕੀ ਆਰਡਰ #{number} ਨੂੰ ਟੇਕਅਵੇ{tableNote} ਵਿੱਚ ਬਦਲਣਾ ਹੈ?",
Relevance

●●● Strong

Clear wording/grammar fix in a locale file; the team consistently accepts Gurmukhi-style and
word-order fixes in confirmation strings, e.g. the zh createWithName word-order fix.

PR-#1043
PR-#850

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The order handler supplies the localized table-release suffix whenever an order has a table; the new
Punjabi confirmation interpolates that suffix between ਟੇਕਅਵੇ and ਵਿੱਚ.

frontend/src/lib/i18n/messages/pa.json[675-675]
frontend/src/lib/i18n/messages/pa.json[691-691]
frontend/src/app/(dashboard)/orders/page.tsx[1536-1544]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Punjabi takeaway confirmation inserts the table-release clause before the postposition that belongs to “takeaway,” producing a malformed prompt when an order has a table.

## Fix Focus Areas
- frontend/src/lib/i18n/messages/pa.json[675-675]
- frontend/src/lib/i18n/messages/pa.json[691-691]

## Recommended Fix
Rewrite the confirmation and table suffix as two coordinated actions, with `ਵਿੱਚ` immediately after `ਟੇਕਅਵੇ`. Check the rendered prompt both with an empty `tableNote` and with a table name.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


2. Punjabi receipt columns undercount text ✓ Resolved

Resolving commit: 630214f

Resolution reason
The fallback segmenter's continuation rule was changed from pendingIndicConjunct to
(pendingIndicConjunct && isIndicConsonant(codePoint)), so a pending virama only absorbs a
following Indic consonant rather than any character. Tests were added asserting 'ਕ੍!' segments as
['ਕ੍', '!'] with width 2 and 'ਕ੍ ਖ' segments as three parts with width 3 in fallback mode.
Description
Adding U+0A4D to INDIC_VIRAMA_CODE_POINTS makes the fallback segmenter merge any character after a
Gurmukhi virama into the preceding cluster, including a space or punctuation. On a runtime without
Intl.Segmenter, text such as ਕ੍! measures as one cell rather than two, affecting thermal
truncation and column alignment.

Grey Divider

Context sources
✅ Linked PRs:
  🌐 PR #34
  🌐 PR #333
  🌐 PR #555
❌ Tickets: failed to load — Ticket collection could not establish complete evidence
✅ Compliance rules (platform): 5 rules
✅ Cross-repo context — repo relationships
  Explored: repo: FreeOpenSourcePOS/FloCafe-Plugins (sha: 19dcb656) — View relationship
Review mode: Auto: ⚖️ Balanced: Large but mostly locale data and tests; logic is shallow.

Grey Divider

Tip of the day
💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread shared/print/width.ts Resolved
Comment thread frontend/src/lib/i18n/messages/pa.json Resolved
khaira777 added a commit that referenced this pull request Nov 7, 2026
…/flocafe-i18n-punjabi`): 1. **Core Test Suite (Shard 3/4) (`npm run test:cash-closures` -> `tests/reports-whatsapp.test.ts`):** - **Invariant:** Every locale-inventory assertion must match the canonical set of 25 supported locale bundles after adding Punjabi (`pa.json`). - **Root Cause & Fix:** `tests/reports-whatsapp.test.ts` still asserted `localeFiles.length === 24` at line 287 (and noted 24 languages in line 853). Updated `tests/reports-whatsapp.test.ts` to `25`. 2. **Playwright E2E (Shard 3/4) (`frontend/e2e/server-app-ordering.spec.ts`):** - **Invariant:** In the shared E2E server (`tests/e2e-server.cjs`), where all specs in a shard execute against one backend instance from a single loopback IP (`127.0.0.1`), per-IP read rate limits must not throttle legitimate test page loads and order reads across consecutive specs. - **Root Cause & Fix:** In Shard 3/4, `selected-guest-checkout.spec.ts` (21 tests) and `server-app-ordering.spec.ts` (9 tests) exhausted the 120 req/min `orderReadRateLimit` in `main/routes/orders.ts`, causing `GET /api/orders` at line 608 of `server-app-ordering.spec.ts` to return HTTP 429 (`"Too many requests, please try again later."`) and causing the retry to time out while the 60s window remained active. Made `orderReadRateLimit` in `main/routes/orders.ts` configurable via `FLO_ORDER_READ_RATE_LIMIT_MAX` (defaulting to `120` in production, matching `FLO_SETTINGS_READ_RATE_LIMIT_MAX` in `main/routes/settings.ts`), set `FLO_ORDER_READ_RATE_LIMIT_MAX = '100000'` in `tests/e2e-server.cjs`, and moved `openServerApp(page, serverToken)` before the 5-viewport resize loop in `frontend/e2e/server-app-ordering.spec.ts` to avoid 4 redundant full-app reloads. 3. **Aggregator Checks (`End-to-End Playwright Tests`, `Required Checks Gate`):** - Failed solely as downstream aggregators of the two shard failures above. 4. **Verification:** - `npm run test:cash-closures` (passed: `tests/cash-closures.test.ts` 370/370 and `tests/reports-whatsapp.test.ts` including all 25 locales) - `node tests/run-electron-node-test.cjs tests/order-write-rate-limits.test.ts` (passed) - `npm run i18n:check` (passed) - `npm run lint` and `npm run build` (passed) - `npx oxfmt --check` on all touched files and `git diff --check` (passed)
khaira777 added a commit that referenced this pull request Nov 7, 2026
…/flocafe-i18n-punjabi`): 1. **Core Test Suite (Shard 3/4) (`npm run test:cash-closures` -> `tests/reports-whatsapp.test.ts`):** - **Invariant:** Every locale-inventory assertion must match the canonical set of 25 supported locale bundles after adding Punjabi (`pa.json`). - **Root Cause & Fix:** `tests/reports-whatsapp.test.ts` still asserted `localeFiles.length === 24` at line 287 (and noted 24 languages in line 853). Updated `tests/reports-whatsapp.test.ts` to `25`. 2. **Playwright E2E (Shard 3/4) (`frontend/e2e/server-app-ordering.spec.ts`):** - **Invariant:** In the shared E2E server (`tests/e2e-server.cjs`), where all specs in a shard execute against one backend instance from a single loopback IP (`127.0.0.1`), per-IP read rate limits must not throttle legitimate test page loads and order reads across consecutive specs. - **Root Cause & Fix:** In Shard 3/4, `selected-guest-checkout.spec.ts` (21 tests) and `server-app-ordering.spec.ts` (9 tests) exhausted the 120 req/min `orderReadRateLimit` in `main/routes/orders.ts`, causing `GET /api/orders` at line 608 of `server-app-ordering.spec.ts` to return HTTP 429 (`"Too many requests, please try again later."`) and causing the retry to time out while the 60s window remained active. Made `orderReadRateLimit` in `main/routes/orders.ts` configurable via `FLO_ORDER_READ_RATE_LIMIT_MAX` (defaulting to `120` in production, matching `FLO_SETTINGS_READ_RATE_LIMIT_MAX` in `main/routes/settings.ts`), set `FLO_ORDER_READ_RATE_LIMIT_MAX = '100000'` in `tests/e2e-server.cjs`, and moved `openServerApp(page, serverToken)` before the 5-viewport resize loop in `frontend/e2e/server-app-ordering.spec.ts` to avoid 4 redundant full-app reloads. 3. **Aggregator Checks (`End-to-End Playwright Tests`, `Required Checks Gate`):** - Failed solely as downstream aggregators of the two shard failures above. 4. **Verification:** - `npm run test:cash-closures` (passed: `tests/cash-closures.test.ts` 370/370 and `tests/reports-whatsapp.test.ts` including all 25 locales) - `node tests/run-electron-node-test.cjs tests/order-write-rate-limits.test.ts` (passed) - `npm run i18n:check` (passed) - `npm run lint` and `npm run build` (passed) - `npx oxfmt --check` on all touched files and `git diff --check` (passed)
@khaira777
khaira777 force-pushed the fm/flocafe-i18n-punjabi branch from 73f88f5 to d2a845f Compare November 7, 2026 07:11
@khaira777 khaira777 changed the title feat(i18n): add Punjabi (pa) locale support chore: update pull request Nov 7, 2026
@khaira777 khaira777 changed the title chore: update pull request feat: add Punjabi (pa) locale support Nov 7, 2026
khaira777 added a commit that referenced this pull request Nov 7, 2026
…/flocafe-i18n-punjabi`): 1. **Core Test Suite (Shard 3/4) (`npm run test:cash-closures` -> `tests/reports-whatsapp.test.ts`):** - **Invariant:** Every locale-inventory assertion must match the canonical set of 25 supported locale bundles after adding Punjabi (`pa.json`). - **Root Cause & Fix:** `tests/reports-whatsapp.test.ts` still asserted `localeFiles.length === 24` at line 287 (and noted 24 languages in line 853). Updated `tests/reports-whatsapp.test.ts` to `25`. 2. **Playwright E2E (Shard 3/4) (`frontend/e2e/server-app-ordering.spec.ts`):** - **Invariant:** In the shared E2E server (`tests/e2e-server.cjs`), where all specs in a shard execute against one backend instance from a single loopback IP (`127.0.0.1`), per-IP read rate limits must not throttle legitimate test page loads and order reads across consecutive specs. - **Root Cause & Fix:** In Shard 3/4, `selected-guest-checkout.spec.ts` (21 tests) and `server-app-ordering.spec.ts` (9 tests) exhausted the 120 req/min `orderReadRateLimit` in `main/routes/orders.ts`, causing `GET /api/orders` at line 608 of `server-app-ordering.spec.ts` to return HTTP 429 (`"Too many requests, please try again later."`) and causing the retry to time out while the 60s window remained active. Made `orderReadRateLimit` in `main/routes/orders.ts` configurable via `FLO_ORDER_READ_RATE_LIMIT_MAX` (defaulting to `120` in production, matching `FLO_SETTINGS_READ_RATE_LIMIT_MAX` in `main/routes/settings.ts`), set `FLO_ORDER_READ_RATE_LIMIT_MAX = '100000'` in `tests/e2e-server.cjs`, and moved `openServerApp(page, serverToken)` before the 5-viewport resize loop in `frontend/e2e/server-app-ordering.spec.ts` to avoid 4 redundant full-app reloads. 3. **Aggregator Checks (`End-to-End Playwright Tests`, `Required Checks Gate`):** - Failed solely as downstream aggregators of the two shard failures above. 4. **Verification:** - `npm run test:cash-closures` (passed: `tests/cash-closures.test.ts` 370/370 and `tests/reports-whatsapp.test.ts` including all 25 locales) - `node tests/run-electron-node-test.cjs tests/order-write-rate-limits.test.ts` (passed) - `npm run i18n:check` (passed) - `npm run lint` and `npm run build` (passed) - `npx oxfmt --check` on all touched files and `git diff --check` (passed)
@khaira777
khaira777 force-pushed the fm/flocafe-i18n-punjabi branch from d2a845f to 630214f Compare November 7, 2026 10:02
khaira777 added a commit that referenced this pull request Nov 7, 2026
…/flocafe-i18n-punjabi`): 1. **Core Test Suite (Shard 3/4) (`npm run test:cash-closures` -> `tests/reports-whatsapp.test.ts`):** - **Invariant:** Every locale-inventory assertion must match the canonical set of 25 supported locale bundles after adding Punjabi (`pa.json`). - **Root Cause & Fix:** `tests/reports-whatsapp.test.ts` still asserted `localeFiles.length === 24` at line 287 (and noted 24 languages in line 853). Updated `tests/reports-whatsapp.test.ts` to `25`. 2. **Playwright E2E (Shard 3/4) (`frontend/e2e/server-app-ordering.spec.ts`):** - **Invariant:** In the shared E2E server (`tests/e2e-server.cjs`), where all specs in a shard execute against one backend instance from a single loopback IP (`127.0.0.1`), per-IP read rate limits must not throttle legitimate test page loads and order reads across consecutive specs. - **Root Cause & Fix:** In Shard 3/4, `selected-guest-checkout.spec.ts` (21 tests) and `server-app-ordering.spec.ts` (9 tests) exhausted the 120 req/min `orderReadRateLimit` in `main/routes/orders.ts`, causing `GET /api/orders` at line 608 of `server-app-ordering.spec.ts` to return HTTP 429 (`"Too many requests, please try again later."`) and causing the retry to time out while the 60s window remained active. Made `orderReadRateLimit` in `main/routes/orders.ts` configurable via `FLO_ORDER_READ_RATE_LIMIT_MAX` (defaulting to `120` in production, matching `FLO_SETTINGS_READ_RATE_LIMIT_MAX` in `main/routes/settings.ts`), set `FLO_ORDER_READ_RATE_LIMIT_MAX = '100000'` in `tests/e2e-server.cjs`, and moved `openServerApp(page, serverToken)` before the 5-viewport resize loop in `frontend/e2e/server-app-ordering.spec.ts` to avoid 4 redundant full-app reloads. 3. **Aggregator Checks (`End-to-End Playwright Tests`, `Required Checks Gate`):** - Failed solely as downstream aggregators of the two shard failures above. 4. **Verification:** - `npm run test:cash-closures` (passed: `tests/cash-closures.test.ts` 370/370 and `tests/reports-whatsapp.test.ts` including all 25 locales) - `node tests/run-electron-node-test.cjs tests/order-write-rate-limits.test.ts` (passed) - `npm run i18n:check` (passed) - `npm run lint` and `npm run build` (passed) - `npx oxfmt --check` on all touched files and `git diff --check` (passed)
@khaira777
khaira777 force-pushed the fm/flocafe-i18n-punjabi branch from 630214f to 9f3f03e Compare November 7, 2026 10:59
Add complete Gurmukhi Punjabi (pa / pa-IN) translations across all 35 namespaces (3,477 keys), register pa in the language registry, add startup/shutdown status messages, localize express and demo setup seed data, add Gurmukhi print/report font fallbacks and virama grapheme cluster handling, regenerate main-process print labels, and extend the i18n and print test suites and documentation.

Fixes #1476
…/flocafe-i18n-punjabi`): 1. **Core Test Suite (Shard 3/4) (`npm run test:cash-closures` -> `tests/reports-whatsapp.test.ts`):** - **Invariant:** Every locale-inventory assertion must match the canonical set of 25 supported locale bundles after adding Punjabi (`pa.json`). - **Root Cause & Fix:** `tests/reports-whatsapp.test.ts` still asserted `localeFiles.length === 24` at line 287 (and noted 24 languages in line 853). Updated `tests/reports-whatsapp.test.ts` to `25`. 2. **Playwright E2E (Shard 3/4) (`frontend/e2e/server-app-ordering.spec.ts`):** - **Invariant:** In the shared E2E server (`tests/e2e-server.cjs`), where all specs in a shard execute against one backend instance from a single loopback IP (`127.0.0.1`), per-IP read rate limits must not throttle legitimate test page loads and order reads across consecutive specs. - **Root Cause & Fix:** In Shard 3/4, `selected-guest-checkout.spec.ts` (21 tests) and `server-app-ordering.spec.ts` (9 tests) exhausted the 120 req/min `orderReadRateLimit` in `main/routes/orders.ts`, causing `GET /api/orders` at line 608 of `server-app-ordering.spec.ts` to return HTTP 429 (`"Too many requests, please try again later."`) and causing the retry to time out while the 60s window remained active. Made `orderReadRateLimit` in `main/routes/orders.ts` configurable via `FLO_ORDER_READ_RATE_LIMIT_MAX` (defaulting to `120` in production, matching `FLO_SETTINGS_READ_RATE_LIMIT_MAX` in `main/routes/settings.ts`), set `FLO_ORDER_READ_RATE_LIMIT_MAX = '100000'` in `tests/e2e-server.cjs`, and moved `openServerApp(page, serverToken)` before the 5-viewport resize loop in `frontend/e2e/server-app-ordering.spec.ts` to avoid 4 redundant full-app reloads. 3. **Aggregator Checks (`End-to-End Playwright Tests`, `Required Checks Gate`):** - Failed solely as downstream aggregators of the two shard failures above. 4. **Verification:** - `npm run test:cash-closures` (passed: `tests/cash-closures.test.ts` 370/370 and `tests/reports-whatsapp.test.ts` including all 25 locales) - `node tests/run-electron-node-test.cjs tests/order-write-rate-limits.test.ts` (passed) - `npm run i18n:check` (passed) - `npm run lint` and `npm run build` (passed) - `npx oxfmt --check` on all touched files and `git diff --check` (passed)
@khaira777
khaira777 force-pushed the fm/flocafe-i18n-punjabi branch from 9f3f03e to 0a40b0c Compare November 7, 2026 11:33
@khaira777
khaira777 merged commit 83e79e5 into main Nov 7, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/flocafe-i18n-punjabi branch November 7, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(i18n): add Punjabi (ਪੰਜਾਬੀ) locale (pa)

1 participant