Repository navigation
Description
Context
A community member requested Persian/Farsi support and suggested adding Iran to the country profile. This issue tracks the work without treating a country entry as complete language support.
Goal
Provide a reliable first-class experience for Iranian businesses using Persian (fa-IR) and the Iran (IR) country profile.
Current status
Persian is implemented end-to-end but not yet selectable by normal users. Final user-facing enablement (Setup/Settings selectors + browser auto-detection) is gated behind Batch J, the acceptance audit.
dir="rtl"and<html lang>are wired, and visual RTL is complete across all operational surfaces.
#241 is an umbrella issue. Follow-up PRs must use
Refs #241only and must not close this issue until all acceptance criteria are complete.
Scope
- Add the Iran country profile with verified locale, currency, timezone, and dialing information.
- Add Persian/Farsi as a supported UI language.
- Add a complete Persian translation with the same key coverage as the existing languages.
- Add RTL document and layout support, including setup, dashboard, POS, KDS, and settings.
- Verify Persian date, number, currency, and text rendering.
- Test browser receipts and thermal receipts with Persian text where the printer supports it.
- Confirm the correct Iranian business identifier terminology (Economic Code,
کد اقتصادی).
Known Native Feedback & Decisions
Confirmed (native feedback — #241 comment from MaMaDTHUG82):
- Iranian Economic Code terminology:
کد اقتصادی(abbreviated EC). - Economic Code is the useful business identifier; no separate
شناسه ملیfield is required. - Rial and Toman are both understood; Toman is natural in daily use; large prices are often shortened in conversation (e.g.
600T/600ت). - Both Persian and Latin digits are used.
- Persian/Shamsi calendar is more natural locally; Gregorian is also understood.
- Full RTL UI is preferred; naturally-LTR content (URLs, email addresses, code, some numbers, technical identifiers) stays explicit LTR.
- Available thermal printer: Meva TP-UN.
Product decisions (Batch G, final):
- Stored amounts stay raw IRR and are never converted; Toman is display-only (1 Toman = 10 Rial).
- Currency display is configurable for Iran only:
rial(default),toman, and colloquialtoman_short(600T/600ت). - Digit preference is configurable for Iran only: locale (Persian) or Latin.
- Calendar preference is configurable for Iran only: locale (Shamsi default), Persian, or Gregorian.
- These options are declared as
localeOptionson the IR country profile and render through a genericLocalePreferencesPanel, so non-Iran tenants see no extra UI and EN/ES/PT behavior is unchanged.
Delivery Checklist
Completed
- Iran country profile:
IR,fa-IR,IRR,Asia/Tehran,+98,Economic Code, no enforced tax ID format (PR feat(i18n): add Persian translation and Iran country profile foundation #267). - Persian runtime plumbing (PR feat(i18n): add Persian runtime language support #270) and semantic HTML
lang/dirplumbing (PR feat(i18n): sync html lang and dir attributes on language change #271). - IR raw ESC/POS financial-line safety (PR fix(printer): preserve IR raw ESC/POS financial lines and layout bounds #273).
- Initial
fa.json— full key parity + translation integrity tests. - Full Persian translation coverage + Iran terminology (PR feat(i18n): complete Persian translation coverage and terminology #335) — machine-assisted; native review still outstanding.
- Shared RTL/LTR direction foundation (PR feat(ui): add shared RTL/LTR direction foundation #336).
- Setup/Auth/Settings RTL (PR feat(ui): complete Setup, Auth, and Settings RTL layout for Persian #337).
- Dashboard/POS/common RTL (PR feat(ui): complete Dashboard, POS, and common flow RTL layout for Persian #338).
- KDS/Server App/WhatsApp RTL (PR feat(ui): complete KDS, Server App, and WhatsApp RTL layout for Persian #339).
- Iran locale/number/currency/calendar policy (Batch G, PR feat(i18n): add Iran locale display preferences and localize tax and error surfaces #351):
- storage contract documented + tested: amounts stay raw IRR, never converted to Toman
- configurable currency display (
rial/toman/toman_short), digits (locale/latin), calendar (locale/persian/gregorian) - centralised
formatMoney/formatNumber/formatDateForTenant+useFormatCurrency/useFormatNumberhooks - regression tests for IR amounts (zero/negative/large), digits, Shamsi dates, timezone boundary, and non-IR tenants
- Region-driven locale preferences (PR feat(i18n): drive region locale preferences from country profile #352) — Iran locale options live in the country profile and render through a generic
LocalePreferencesPanelonly when a profile declareslocaleOptions; EN/ES/PT unaffected. - Tax/error surface i18n (PR feat(i18n): add Iran locale display preferences and localize tax and error surfaces #351) — TaxConfigurationPanel and backend error surfaces localized.
- User-facing error fallback localization (PR fix(i18n): replace raw error string interpolation with localized fallbacks #353) — failure toasts and inline error states render localized
t()fallbacks instead of raw English backend error/message strings; backend/logs/telemetry keep English; added e2e coverage (localize-error-fallbacks.spec.ts).
Still pending
- Native translation completion/review —
fa.jsonis machine-assisted; native linguistic review still required (Settings/WhatsApp/print-test especially). - Demo-data language handling audit.
- Browser receipt support (Batch H).
- Raw thermal receipt support/fallback (Batch I).
- Final Persian user-facing enablement + feat(i18n): add Persian/Farsi and Iran support #241 acceptance audit (Batch J) — Setup/Settings selectors + browser auto-detection, only after all prerequisites pass.
Next batches
Batch H — Persian Browser Receipt Support
Make browser/HTML receipt printing correct and readable for Persian/Iran. This covers browser printing only (not raw ESC/POS, except shared formatters). Audit classic/compact/detailed templates, labels, amounts, dates, customer/business info, tax identifiers, payment lines, footer, print CSS, fonts, direction, and mixed bidi. Browser receipts in Persian should support translated labels, RTL content with mixed LTR islands, chosen Iran amount/number/date behavior, and readable data. URLs, phone numbers, invoice/order IDs may need explicit direction handling. Do not convert Persian browser Rial output to IRR merely because raw printers may require that fallback. Verify Persian labels, mixed Persian/Latin content, long product names, large amounts, narrow widths, totals/tax/discount/payment lines, Iran date/number behavior, and EN/ES/PT regressions.
Batch I — Persian Raw Thermal Printing and Safe Fallback
Move beyond the narrow financial-line protection in #273 and determine the correct supported behavior for full Persian thermal receipt printing. Verify the current thermal architecture, encoders, printer profiles, Unicode/code-page behavior, fallback behavior, and known Meva TP-UN capabilities. Investigate character encoding, printer code pages, Persian/Arabic glyph availability, contextual shaping, bidi ordering, raster/image fallback, unsupported-character detection, and printer capability detection. Prefer explicit capability behavior over corrupted output; fail safely or use a documented fallback when a raw printer cannot reliably render Persian. Distinguish code-level tests from real hardware verification (only a real print proves physical output).
Batch J — Final Persian User Enablement and #241 Acceptance Audit
Re-read #241, every comment, Discussion #239, all merged #241 PRs, and current main; build an acceptance matrix (PASS/BLOCKED/FAIL/NEEDS HUMAN VERIFICATION) for every criterion. Do not expose Persian unless all core requirements pass. If ready: add Persian to Setup/Settings language selection, add browser-language detection, verify server-side language persistence and standalone-KDS inheritance, verify changing back to EN/ES/PT, and confirm <html lang>/<html dir> transitions. Update documentation and this issue's checklist. Only this batch may use Fixes #241; otherwise keep #241 open.
Out of scope for the initial language/country contribution
- This issue does not by itself promise official Iranian tax compliance or a complete Iranian tax pack. Tax rules should be added separately after they are verified.
- Payment-provider, fiscal e-invoicing, and other Iran-specific integrations are separate work.
Contribution notes
This is broad enough to be split into smaller pull requests after someone takes ownership. A contributor who can provide or review native Persian translations and local tax terminology would be especially valuable. The initial implementation should avoid shipping a partial translation or an untested RTL layout as if support were complete.
Acceptance criteria
- Persian can be selected during setup and in settings, persists server-side, and is inherited by the standalone KDS.
- The main POS flows do not expose raw translation keys and render correctly in RTL.
- Country selection for Iran supplies the expected locale, currency, timezone, and phone dial code.
- Dates, amounts, and receipts are tested for the chosen Rial/Toman behavior.
- Unsupported printer capabilities fail safely or use a documented fallback.
- Existing English, Spanish, and Portuguese behavior remains unchanged.
Activity
MaMaDTHUG82 commentedon Aug 12, 2026
on it
khaira777 commentedon Aug 12, 2026
@MaMaDTHUG82
Thanks for taking this on. Issue #241 covers several areas, so feel free to break the work into smaller focused PRs if that makes sense.
Start with the parts you can handle and verify. If you get stuck on anything or the scope feels too large, comment here and we can help split it up or take on a piece.
MaMaDTHUG82 commentedon Aug 12, 2026
thank you too sir to let me do it , @khaira777
The fact is that Iranians should feel more comfortable in English ( User Friendly ), that's why we work with English in various programs most of the time.
Because Persian has not always been in all games or programs
I translated various parts of the program except for the settings into Persian, because it was really not understandable and even I myself can't figure it out because the meanings are complicated...
I tried if the writing stays LTR, it won't interfere with the menus
I want to run this program in my friend's restaurant, I'll definitely send pictures of it later
And inside Iran, taxes are strange and considering the economy, it doesn't seem to exist at all, businesses with low sales are not taxed and people with high-profit businesses also bypass it, but I'm going to set it in the files
MaMaDTHUG82 commentedon Aug 12, 2026
fa.json
i did the #267 , was terrible
MaMaDTHUG82 commentedon Aug 12, 2026
the dial code looks like india , but instead +91 its +98
and if LTR with this fa.json makes problems that not so emergence we could pass it , its need alot of time to fix it surly , after that we even could add more LTR languages .
need a icon for IRR for currency
khaira777 commentedon Aug 12, 2026
@MaMaDTHUG82 You actually did a lot of useful work here, especially for a first GitHub contribution. The Persian translation itself is a big contribution - #241 just turned out to touch much more technical plumbing than it looks like from the outside.
I’m going to help take over the technical integration from here on this same PR so your contribution and authorship stay attached to it. We’ll split the remaining RTL, KDS, formatting and printer work into smaller follow-ups rather than asking you to solve everything at once.
Your Persian knowledge is the part we need most. Once the technical pieces are wired up, it would be really useful if you could review the wording and eventually test it at your friend’s restaurant like you mentioned.
Thanks for jumping into this - this is exactly how open-source contributions get built through review and collaboration.
khaira777 commentedon Aug 12, 2026
@MaMaDTHUG82 Thanks - your earlier answer about using کد اقتصادی for the Economic Code is clear, so we’ll use that.
A few more Iran-specific UX questions would help us avoid guessing:
For restaurant prices and receipts, what feels most natural: ﷼, ریال, or تومان?
If people usually think in Toman, should FloCafe still store amounts in IRR/Rial and only offer Toman as an optional display?
For prices, quantities and phone numbers, do users normally expect Persian digits like ۱۲۳۴ or Latin digits like 1234?
For dates, would you expect the Persian/Shamsi calendar, Gregorian, or an option for both?
Is keeping the current layout LTR temporarily still usable enough for you while we work on full RTL separately?
If your friend’s restaurant has a thermal printer, could you tell us the printer model? That would help later with real Persian receipt testing.
One more small question: for an Iranian restaurant receipt/settings page, is کد اقتصادی enough as the business identifier, or would شناسه ملی normally also need to appear as a separate field?
No need to research legal rules for us - just tell us what feels normal in real use. We’ll verify tax/compliance separately.
feat(i18n): add Persian/Farsi and Iran support
feat(i18n): add Persian translation and Iran country profile foundati…
21 remaining items
khaira777 commentedon Aug 17, 2026
Batch D — Setup, Auth, and Settings RTL completion (PR #337)
PR #337 (Refs #241) makes Setup, the auth screens, and Settings visually usable in Persian RTL using the shared RTL/LTR foundation from PR #336.
What changed
ms/me/ps/pe/start/end/text-start/text-end/border-s/border-e) across the Setup wizard, login/recover pages, the Settings page, and the Settings components (TaxConfigurationPanel, PaymentMethodsSettings, InitializeDatabaseDialog, HealthCheckDialog)..rtl-flipclass so they mirror in RTL.rtl:variant.<Ltr>islands so they stay readable inside RTL UI: URLs, emails, pairing codes, version strings, tax/Economic Code, phone numbers, timezone/currency codes, IP addresses, and technical identifiers (category/rule ids, invoice/order number previews). Technical inputs getdir="ltr".Verification
tests/rtl-setup-auth-settings.test.ts(static direction-utility guard +<Ltr>polymorphic render checks) registered innpm test.dir=rtl/dir=ltr, LTR islands, and no horizontal overflow in RTL.tsc --noEmit, frontend + backend lint,build:frontend(validatesrtl:variant +.rtl-flipoutput),build, full PR CI (linux-tests, e2e-playwright, CodeQL, dependency-review) — all pass. no-mistakes pipeline: 0 findings.Still required before Persian enablement
refactor(i18n): resolve text direction from shared language metadata
feat(ui): complete Dashboard, POS, and common flow RTL layout for Per…
feat(rtl): complete KDS, Server App, and WhatsApp RTL surfaces for Pe…
khaira777 commentedon Aug 17, 2026
Batch G — Iran locale, number, currency, and calendar policy (final)
Policy (decided with maintainer — supersedes the earlier Rial-only draft):
rial(default),toman, and colloquialtoman_short(600T/600ت).localeOptionson the IR country profile and render through a genericLocalePreferencesPanel, so non-Iran tenants see no extra UI and EN/ES/PT behavior is unchanged.What changed:
formatMoney/formatNumber/formatDateForTenantin the shared country module plususeFormatCurrency/useFormatNumberhooks.tests/locale-iran.test.tscovering IR amounts (zero/negative/large), no-Toman-conversion, digits, Shamsi dates, theAsia/Tehranmidnight boundary, and unchanged non-IR tenants. Wired intotest:currency.User-facing error i18n (fixed):
TaxConfigurationPaneland the standalone server app are fully localized.t()fallbacks instead of raw English backend error/message strings. Backend, logs, and telemetry keep English; users never see raw English strings. Addedlocalize-error-fallbacks.spec.tse2e coverage (26 assertions across fa/es/pt/en).web-print.tspopup toast intentionally deferred to Batch H (browser receipts).Verification: root + frontend
tsc --noEmit, frontend + backend lint,build,build:frontend,test:currency,test:translations, and full PR CI (linux-tests, e2e-playwright, CodeQL, dependency-review) all pass. Persian wording remains machine-assisted and still needs native review.feat(ui): complete KDS, Server App, and WhatsApp RTL layout for Persi…
feat(i18n): add Iran locale display preferences and localize tax and …
feat(i18n): drive region locale preferences from the country profile (#…
fix(i18n): replace raw error string interpolation with localized fall…
khaira777 commentedon Aug 17, 2026
Batch I — Persian raw thermal printing & safe fallback
Implemented and committed on
feat/241-i-persian-thermal-fallback(44113e7); no-mistakes pipeline is running async (PR link to be added when it opens).What changed
arabicShapingcapability flag to printer profiles (main/printers/profiles.ts), defaulting to off.renderEscposLineTemplateV1), and KOT — inmain/printers/thermal.ts.buildEscPosnow emits Arabic/Persian script only when the profile declaresarabicShaping; otherwise the line is skipped with a precise warning naming the cause. Mixed Persian + other non-ASCII lines are always skipped, even with the flag.ریال → IRRASCII fallback keeps amounts printing on generic hardware.warnings.ts) warning now names Persian/Arabic script instead of the generic "unsupported characters".Behavior (deterministic, tested)
arabicShaping: true: emitted as UTF-8.tscbuild and lint clean.Hardware boundary (needs human verification)
arabicShaping: trueon a profile after a real print on that hardware proves shaped Persian output.feat(i18n): enable Persian language selection and complete #241 accep…
docs(printing): add non-Latin ESC/POS capability study and hardware-t…