Skip to content

feat: add Hausa (ha) locale support - #1494

Merged
khaira777 merged 4 commits into
mainfrom
fm/flocafe-i18n-hausa
Nov 7, 2026
Merged

khaira777 merged 4 commits into
mainfrom
fm/flocafe-i18n-hausa

Conversation

@khaira777

@khaira777 khaira777 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Implement full Hausa (ha, ha-NG, Hausa) 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 #1478

What Changed

  • Added the Hausa (ha / ha-NG) locale to the frontend language registry (frontend/src/lib/i18n/languages.ts) along with the complete message catalog (frontend/src/lib/i18n/messages/ha.json).
  • Added Hausa translations for Electron startup/shutdown status messages (main/status-messages.ts), generated thermal receipt/KOT/Z-report/WhatsApp print labels (main/print/print-labels.generated.ts), and localized sample catalog seed data (main/setup/seed-data.ts).
  • Expanded unit, print, locale-decoupling, and E2E test suites and updated project documentation to cover the 25 supported locales including Hausa.

Risk Assessment

✅ Low: Additive Hausa (ha / ha-NG) locale registration, message catalogue, generated print labels, express/demo seed data, documentation updates, and test coverage following the existing language-addition contract without altering core runtime control flow or database schema.

Testing

Ran npm run i18n:check, all 11 localization, receipt, print-label, WhatsApp report, RTL/LTR, and status-message test suites (including tests/status-messages.test.ts and tests/reports-whatsapp.test.ts covering the uncommitted changes), plus the Playwright E2E print-test locale suite and isolated live FloCafe servers (:4401, :4402, :4403) to capture visual and text evidence across Setup, POS, Settings, KDS, Customer Display, Server App, browser/thermal receipts and KOTs, WhatsApp reports, and Electron status messages in Hausa (ha); all checks and live scenarios passed.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Select Hausa (ha) during first-run Setup, seed Nigeria/Hausa demo data, and navigate POS and Settings in Hausa ✅ pass live ~/.no-mistakes/evidence/01M6SGSVDZPTFAYDXWFEFA5WBV/setup-hausa.png, ~/.no-mistakes/evidence/01M6SGSVDZPTFAYDXWFEFA5WBV/pos-hausa.png, ~/.no-…
Operate KDS, Customer Display, and standalone Server App in Hausa (ha) with live order tickets ✅ pass live ~/.no-mistakes/evidence/01M6SGSVDZPTFAYDXWFEFA5WBV/kds-hausa.png, ~/.no-mistakes/evidence/01M6SGSVDZPTFAYDXWFEFA5WBV/customer-display-hausa.png, ~
Render browser print receipts, print-test controls, and thermal receipt/KOT tickets in Hausa (ha / ha-NG) ✅ pass live ~/.no-mistakes/evidence/01M6SGSVDZPTFAYDXWFEFA5WBV/receipt-hausa.png, ~/.no-mistakes/evidence/01M6SGSVDZPTFAYDXWFEFA5WBV/thermal-whatsapp-status-hausa.txt, fron…
Generate WhatsApp plain-text Daily Sales and Cash Close Z-Reports and Electron lifecycle status messages in Hausa (ha) ✅ pass live ~/.no-mistakes/evidence/01M6SGSVDZPTFAYDXWFEFA5WBV/thermal-whatsapp-status-hausa.txt, tests/reports-whatsapp.test.ts, tests/status-messages.test.ts
Adversarial check: enforce ICU placeholder parity, Boko NFC/hooked-letter integrity, and no welded order numbers across all 3,477 Hausa keys and 25 locales ✅ pass live npm run i18n:check, tests/print-labels.test.ts, tests/phase3-print-regressions.test.ts

Setup wizard rendered in Hausa (ha)
Main POS app with Hausa UI and Nigeria sample seed data
Settings screen rendered in Hausa (ha)
Standalone KDS rendered in Hausa (ha)
Customer Display rendered in Hausa (ha)
Standalone Server App rendered in Hausa (ha) with tableside order ticket
Browser print receipt rendered in Hausa (ha-NG) with Boko hooked characters

Evidence: Thermal receipt, thermal KOT, WhatsApp daily sales/Z-report, and Electron status messages in Hausa (ha)
=== THERMAL RECEIPT (ha) ===
{INIT}
{STORE_NAME}{CENTER}{BOLD}{DOUBLE_HEIGHT}{DOUBLE_WIDTH}Arewa Bistro{/DOUBLE_WIDTH}{/DOUBLE_HEIGHT}{/BOLD}{/CENTER}
{CENTER}{FONT_B}Aminu Kano{/FONT_B}{/CENTER}
{CENTER}+2348031234567{/CENTER}
------------------------------------------------
{CENTER}Lambar rasiti: BILL-20261107-0001{/CENTER}
{CENTER}07/11/2026 07:30:00{/CENTER}
{CENTER}Tebur: T1{/CENTER}
------------------------------------------------
Abu                               Yawa      Kuɗi
------------------------------------------------
Tsire Suya                        2    NGN560.00
  Bayani: Mai zafi
Tuwon Shinkafa                    1    NGN800.00
------------------------------------------------
Jimillar ƙasa                        NGN1,360.00
Haraji                                 NGN102.00
{BOLD}BABBAR JIMILLA                       NGN1,462.00{/BOLD}
Kuɗin hannu                          NGN1,462.00
------------------------------------------------
{CENTER}14 Ahmadu Bello Way, Kano{/CENTER}
{CENTER}Waya: +2348030001111{/CENTER}


{CENTER}{FONT_B}Powered by FloPOS (flopos.com){/FONT_B}{/CENTER}
{CUT}

=== THERMAL KOT (ha) ===
TAKARDAR ODAR GIRKI

Tasha: Grill
Oda #ORD-20261107-0001
Tebur: T1
Nau'i: Ci a ciki
Abokin ciniki: Aminu Kano
Lokaci: 07:30:00

!! Bayani: Kar a sa yaji sosai
================================================

2x  Tsire Suya
  >> Mai zafi
1x  Tuwon Shinkafa

================================================

=== WHATSAPP DAILY SALES REPORT (ha) ===
*Arewa Bistro*
Rahoton Ciniki na Yau da Kullum
Ranar kasuwanci: 7 Nuw, 2026 (Africa/Lagos)
Ododi: 0 · Lissafi: 0

*TAƘAITACCEN CINIKI*
Jimillar Kuɗin da Aka Tara: ₦ 0.00
Mayar da Kuɗi: ₦ 0.00
*Tsantsar Kuɗin da Aka Tara: ₦ 0.00*
Haraji: ₦ 0.00
Rangwame: ₦ 0.00
Kuɗin Hidima: ₦ 0.00
Kunshi: ₦ 0.00
Isarwa: ₦ 0.00

*Hanyoyin Biyan Kuɗi*
- (babu)

*Kayayyakin da Aka Fi Sayarwa*
- (babu)

=== WHATSAPP CASH CLOSE Z-REPORT (ha) ===
📊 *Rahoton Z #1 - Arewa Bistro*
📅 *Ranar kasuwanci:* 7 Nuw, 2026 (7/11/26, 01:00 - 8/11/26, 00:59)
👤 *Wanda ya rufe:* Aminu Kano

💰 *TAƘAITACCEN CINIKI*
• Jimillar Kuɗin da Aka Tara: ₦ 14,620.00
• Mayar da Kuɗi: ₦ 0.00
• Tsantsar Kuɗin da Aka Tara: ₦ 14,620.00
• Lissafi: 10

💳 *BIYAN KUƊI*
• Kuɗin hannu: ₦ 14,620.00 (10)

💵 *DAIDAITA AKWATIN KUƊI*
• Kuɗin farawa na akwati: ₦ 5,000.00
• Kuɗin da ake tsammani: ₦ 19,620.00
• Kuɗin da aka ƙirga: ₦ 19,620.00
• Bambanci: ₦ 0.00 (✅ Daidai)

📝 *Bayanai:* An kirga kudin kashi sau biyu

=== ELECTRON STATUS MESSAGES (ha, isRtl=false) ===
starting: Ana fara Flo — Ana shirya komai…
checking: Ana duba bayananka — Ana tabbatar da ma'adanar bayanai tare da kiyaye lafiyarta…
backingUp: Ana ajiyar bayananka — Ana adana kwafi mai aminci kafin ka fara…
services: Ana fara ayyuka — An kusa kammalawa…
welcome: Barka da zuwa Flo — Ana buɗe wurin aikinka…
closing: Ana rufe Flo — Ana adana bayananka. Don Allah kada ka kashe kwamfutar.
shutdownBackup: Ana yin ajiyar bayanai — Don Allah kada ka kashe kwamfutar.
saved: An adana komai — Flo zai rufe nan take.
- Outcome: 🔧 2 issues found → no changes applied ✅ across 2 runs (47m37s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

🔧 **Test** - 2 issues found → no changes applied ✅
  • ⚠️ The Test agent did not finish within its invocation budget. Reported: agent run tests timed out after 30m0s: agent last produced output 436ms ago (412 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.
  • 🚨 Approval is refused: the run worktree at ~/.no-mistakes/worktrees/de2296f2e6f8/01M6SGSVDZPTFAYDXWFEFA5WBV holds work no Test turn validated, and the steps after Test would commit and publish it. It holds uncommitted changes to main/status-messages.ts, tests/reports-whatsapp.test.ts (inspect with git -C ~/.no-mistakes/worktrees/de2296f2e6f8/01M6SGSVDZPTFAYDXWFEFA5WBV status and git -C ~/.no-mistakes/worktrees/de2296f2e6f8/01M6SGSVDZPTFAYDXWFEFA5WBV diff). Respond with fix to validate it, or abort.

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

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Select Hausa (ha) during first-run Setup, seed Nigeria/Hausa demo data, and navigate POS and Settings in Hausa ✅ pass live ~/.no-mistakes/evidence/01M6SGSVDZPTFAYDXWFEFA5WBV/setup-hausa.png, ~/.no-mistakes/evidence/01M6SGSVDZPTFAYDXWFEFA5WBV/pos-hausa.png, ~/.no-…
Operate KDS, Customer Display, and standalone Server App in Hausa (ha) with live order tickets ✅ pass live ~/.no-mistakes/evidence/01M6SGSVDZPTFAYDXWFEFA5WBV/kds-hausa.png, ~/.no-mistakes/evidence/01M6SGSVDZPTFAYDXWFEFA5WBV/customer-display-hausa.png, ~
Render browser print receipts, print-test controls, and thermal receipt/KOT tickets in Hausa (ha / ha-NG) ✅ pass live ~/.no-mistakes/evidence/01M6SGSVDZPTFAYDXWFEFA5WBV/receipt-hausa.png, ~/.no-mistakes/evidence/01M6SGSVDZPTFAYDXWFEFA5WBV/thermal-whatsapp-status-hausa.txt, fron…
Generate WhatsApp plain-text Daily Sales and Cash Close Z-Reports and Electron lifecycle status messages in Hausa (ha) ✅ pass live ~/.no-mistakes/evidence/01M6SGSVDZPTFAYDXWFEFA5WBV/thermal-whatsapp-status-hausa.txt, tests/reports-whatsapp.test.ts, tests/status-messages.test.ts
Adversarial check: enforce ICU placeholder parity, Boko NFC/hooked-letter integrity, and no welded order numbers across all 3,477 Hausa keys and 25 locales ✅ pass live npm run i18n:check, tests/print-labels.test.ts, tests/phase3-print-regressions.test.ts
  • npm run i18n:check
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/status-messages.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/print-labels.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/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/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
  • CI=1 E2E_BASE_URL=http://127.0.0.1:4301 E2E_KDS_BASE_URL=http://127.0.0.1:4302 E2E_SERVER_APP_BASE_URL=http://127.0.0.1:4303 npx --prefix frontend playwright test e2e/phase7-setup-print-i18n.spec.ts --config frontend/playwright.config.ts
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@coderabbitai

coderabbitai Bot commented Nov 7, 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 Hausa locale across FloCafe

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Add selectable Hausa translations across FloCafe’s interfaces and Electron status window.
• Localize print labels and Nigerian sample data so setup and printed output remain in Hausa.
• Extend locale checks, regression tests, and documentation for 25 supported languages.
Diagram

graph TD
  Setup["Language selection"] --> Registry["Language registry"] --> Catalog["Hausa catalogue"] --> UI["App interfaces"]
  Setup --> Seed["Sample data"]
  Catalog --> Generator["Label generation"] --> Print["Printed output"]
  Registry --> Status["Electron status"]
Loading
High-Level Assessment

Use the existing registry, message catalogue, generated-label, and seed-data conventions. A separate Hausa localization path would duplicate established behavior without a clear benefit; the main review priority is translation quality and parity across output surfaces.

Files changed (23) +8795 / -1612

Enhancement (5) +5226 / -460
languages.tsRegister selectable Hausa +7/-0

Register selectable Hausa

• Registers ha with the ha-NG locale, Hausa display name, LTR direction, and lazy catalogue loader.

frontend/src/lib/i18n/languages.ts

ha.jsonAdd complete Hausa message catalogue +3601/-0

Add complete Hausa message catalogue

• Provides Hausa messages for application interfaces, setup, printing, and reports, including ICU templates and preserved technical literals.

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

print-labels.generated.tsGenerate Hausa print-label table +148/-0

Generate Hausa print-label table

• Adds ha to supported print-label languages and supplies Hausa labels for receipts, kitchen and delivery tickets, Z-reports, print tests, and report sharing.

main/print/print-labels.generated.ts

seed-data.tsLocalize Hausa express and demo seeds +1460/-460

Localize Hausa express and demo seeds

• Recognizes ha when selecting seed data and adds Hausa menu, staff, and Nigerian customer examples. Much of the remaining diff reformats existing seed expressions.

main/setup/seed-data.ts

status-messages.tsAdd Hausa native status messages +10/-0

Add Hausa native status messages

• Supplies Hausa text for all eight Electron startup and shutdown status states.

main/status-messages.ts

Tests (12) +3533 / -1132
phase7-setup-print-i18n.spec.tsCheck Hausa print-test controls in E2E +69/-13

Check Hausa print-test controls in E2E

• Adds expected Hausa labels for thermal receipt, browser print, and WhatsApp controls to the registered-language E2E loop. Reformats existing label entries.

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

browser-receipts.test.tsCover Hausa browser print output +750/-442

Cover Hausa browser print output

• Extends receipt locale coverage and checks Hausa order-slip text, ha-NG language metadata, and LTR rendering. Also reformats existing test cases.

tests/browser-receipts.test.ts

decoupled-ui-locale.test.tsTest Hausa UI with independent store region +260/-51

Test Hausa UI with independent store region

• Adds Hausa to receipt scenarios using an Argentine store context and asserts that receipt labels follow the UI language. Reformats surrounding assertions.

tests/decoupled-ui-locale.test.ts

i18n-audit-remediations.test.tsInclude Hausa in localization audits +207/-68

Include Hausa in localization audits

• Adds ha to locale loops that check translated UI and message-key coverage. Most other changes reformat existing fixtures and assertions.

tests/i18n-audit-remediations.test.ts

phase3-print-regressions.test.tsAdd Hausa to print regression matrix +742/-258

Add Hausa to print regression matrix

• Includes ha in the tested language set for print and kitchen-ticket regressions. Reformats substantial existing test code.

tests/phase3-print-regressions.test.ts

phase7-setup-i18n.test.tsVerify Hausa setup seed content +510/-109

Verify Hausa setup seed content

• Asserts Hausa express and demo names, including Nigerian E.164 customer numbers, within the registered-locale seed checks. Reformats existing setup tests.

tests/phase7-setup-i18n.test.ts

print-labels.test.tsAssert Hausa thermal-label terminology +367/-82

Assert Hausa thermal-label terminology

• Checks Hausa totals, bill number, amount, and distinct takeaway, delivery, and subtotal labels. Reformats existing print assertions.

tests/print-labels.test.ts

reports-whatsapp.test.tsExpect 25 report locales +1/-1

Expect 25 report locales

• Raises the expected message-catalogue count so WhatsApp report localization checks include Hausa.

tests/reports-whatsapp.test.ts

rtl-dashboard-pos-common.test.tsAssert Hausa remains LTR +2/-0

Assert Hausa remains LTR

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

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

rtl-kds-server-whatsapp.test.tsExtend KDS and Server App locale loops +212/-50

Extend KDS and Server App locale loops

• Adds ha to UI translation and direction-related test matrices covering KDS, Server App, and WhatsApp surfaces. Reformats nearby assertions.

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

rtl-setup-auth-settings.test.tsTest Hausa browser-language resolution +251/-58

Test Hausa browser-language resolution

• Checks that ha-NG, bare ha, and ha-NE resolve to Hausa and adds ha to setup and settings translation coverage. Reformats existing cases.

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

translations.test.tsGuard Hausa translation completeness +162/-0

Guard Hausa translation completeness

• Adds an allowlist for intentionally shared literals and checks for English fallback, placeholders, non-NFC text, and replacement characters. Pins key Hausa terminology and CSV field literals.

tests/translations.test.ts

Documentation (6) +36 / -20
CONTRIBUTING.mdList Hausa among supported translations +1/-1

List Hausa among supported translations

• Adds Hausa to the contributor-facing list of available languages.

CONTRIBUTING.md

README.mdAdvertise Hausa UI support +1/-0

Advertise Hausa UI support

• Adds Hausa to the README’s supported-language list.

README.md

frontend.mdUpdate frontend locale counts +3/-3

Update frontend locale counts

• Updates registry and message-catalogue descriptions from 24 to 25 locales.

docs/architecture/frontend.md

internationalization.mdDocument the 25th catalogue +3/-3

Document the 25th catalogue

• Updates the supported-language count and adds ha to the catalogue inventory.

docs/architecture/internationalization.md

adding-a-language.mdDocument status-message and test requirements +21/-12

Document status-message and test requirements

• Adds native startup and shutdown messages to the language-addition procedure. Updates normalization guidance and test-matrix coverage figures.

docs/guides/adding-a-language.md

translation-terminology.mdRecord canonical Hausa terminology +7/-1

Record canonical Hausa terminology

• Documents Hausa receipt, dietary-tag, takeaway, and cash-movement terms and adds Hausa to the NFC guidance.

docs/reference/translation-terminology.md

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

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

@khaira777
khaira777 enabled auto-merge (squash) November 7, 2026 06:29
@khaira777
khaira777 merged commit 461c862 into main Nov 7, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/flocafe-i18n-hausa branch November 7, 2026 06:41
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 Hausa (Hausa) locale (ha)

1 participant