Skip to content

feat(i18n): add Persian/Farsi and Iran support #241

Description

@khaira777

Context

Discussion: https://github.com/orgs/FreeOpenSourcePOS/discussions/239

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 Implementation Status

Persian is recognized internally, but it is intentionally not selectable by normal users yet. dir="rtl" support currently provides semantic document direction only; it does not mean all visual RTL layout work is complete.

#241 is an umbrella issue. Follow-up PRs must use Refs #241 only 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 before choosing the tax registration label. Rial is a currency, not a tax identifier.

Known Native Feedback & Decisions

Confirmed:

  • Iranian Economic Code terminology: کد اقتصادی

Awaiting Native Feedback / Decision:

  • / ریال / تومان
  • whether Toman is display-only while storage remains IRR
  • Persian vs Latin digits
  • Shamsi/Persian vs Gregorian calendar
  • whether temporary LTR UI is acceptable
  • available thermal printer model
  • whether شناسه ملی should be a separate field

Delivery Checklist

Completed

  • Iran country profile:

    • IR
    • fa-IR
    • IRR
    • Asia/Tehran
    • +98
    • Economic Code
    • no enforced tax ID format
  • Initial fa.json

    • full key parity
    • translation integrity tests
  • Internal Persian runtime plumbing

    • canonical Language type recognizes fa
    • Persian translation bundle registered
    • Zustand/auth/Tenant language plumbing
    • server/KDS metadata accepts fa
  • Semantic document language/direction plumbing

    • main application fa -> lang="fa-IR" / dir="rtl"
    • standalone KDS equivalent handling

Still pending

  • Native translation completion/review

    • 732 out of 1668 values are currently identical to English on current main
    • structural key completeness does NOT equal linguistic completeness
  • Persian user-facing enablement

    • Setup selector
    • Settings selector
    • browser auto-detection
    • keep disabled until readiness requirements are met
  • Visual RTL verification/fixes

    • setup
    • auth
    • dashboard
    • POS
    • dialogs
    • Settings
    • KDS
    • mixed LTR/RTL fields
  • Audit remaining hard-coded EN/ES/PT assumptions

    • include demo-data language handling
    • locale-specific screens such as WhatsApp
    • identify other cases but do NOT fix them in this task
  • Iran-specific localized terminology

    • Persian UI should display Economic Code as کد اقتصادی
    • determine whether شناسه ملی needs a separate field
    • do not hardcode Persian into shared country data
  • Locale UX decisions

    • Rial vs Toman display
    • storage/display conversion policy
    • Persian vs Latin digits
    • Persian/Shamsi vs Gregorian calendar
    • never silently convert monetary units
  • Browser receipt support

    • Persian direction
    • localized receipt labels
    • mixed-direction content
    • date/number/currency behavior
    • font/render verification
  • Raw thermal receipt support/fallback

    • ESC/POS encoding
    • Persian glyph support
    • shaping
    • bidi order
    • unsupported-printer fallback
    • physical printer verification
  • Final focused tests/documentation

  • Final Persian Setup/Settings enablement only after prerequisites pass

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.

Metadata

Metadata

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions