Repository navigation
fix(i18n): fix SYP currency display and add Syria - #1591
Conversation
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 39 minutes. View limit details
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. |
|
@greptile review |
[Medium impact] The PR appears safe to merge; no actionable issues were found.
|
Intent
Fixes #1584
Fix #1584 so selecting Syrian Pound (
SYP) displaysل.س.(in Arabic locales) orSYP(in non-Arabic locales) consistently across FloCafe and printed receipts instead of the generic narrow pound sign (£), add Syria (SY) to the country selection list, and preserve standard narrow symbol display ($,£,€,E£,L£, etc.) for currencies likeCAD,AUD,USD, and Sterling-pegged pound currencies (GBP,FKP,GIP,SHP).What Changed
resolveIntlCurrencyDisplayinmain/countries.ts(re-exported viafrontend/src/lib/countries.ts) and used it acrossgetCurrencySymbol,formatCurrency,formatMoney,regionalCurrencyPosition, andfrontend/src/lib/printer/web-print.tsso non-sterling pound currencies (SYP,SSP) resolve tosymbolorcodeinstead of bare£, while preservingnarrowSymbolfor other currencies.isAmbiguousCurrencySymboland'ل.س': 'SYP'inshared/print/currency.ts, and updatedmain/printers/formatting-helpers.ts,frontend/src/lib/printer/receipt-encoder.ts, andfrontend/src/lib/printer/tax-bill-encoder.tsso ESC/POS receipt encoding falls back from bare£(when notGBP) and¥/\uFFE5(when notJPY) to the ISO currency code.SY,SYP,ar-SY,Asia/Damascus) country profile inmain/countries.ts, mappedSYtoSYPinfrontend/src/lib/cart-price.ts, exportedderiveCurrencySymbolinmain/routes/settings.ts, updatedREADME.md, and added coverage across the currency, receipt, cart-price, and country test suites.Risk Assessment
✅ Low: The changes cleanly scope Intl symbol fallback to non-sterling pound currencies, add the Syria country profile consistently across backend, frontend, cart pricing, and print fallback paths, and preserve narrow symbols for other currencies.
Testing
All 5 focused automated suites and all 4 live Chromium E2E scenarios across isolated FloCafe instances passed after building backend and desktop frontend artifacts, with 10 screenshots and thermal/currency transcript evidence saved and verified.
Evidence: Thermal receipt previews (ASCII & Unicode) and Chromium Intl currency matrix transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
main/countries.ts:245-main/countries.ts:245addsSY(SYP, which has 0 fraction digits inIntl.NumberFormat), but the sibling country-to-currency mapNON_TWO_DECIMAL_COUNTRY_CURRENCIESinfrontend/src/lib/cart-price.ts:11-40(which lists every other non-2-decimal country such asIQ,JO,LB,YE) does not includeSY: 'SYP'. WhencurrencyFractionDigits('SY'),resolveActiveCurrencyDecimals('SY'), ordecimalsFromTenantRecord({ country: 'SY' })is called without an explicitcurrency/currency_fraction_digits,frontend/src/lib/cart-price.ts:46-49falls through with 2-letter'SY'and returns2decimal places instead of0. AddSY: 'SYP'toNON_TWO_DECIMAL_COUNTRY_CURRENCIES.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
npm run build && npm run build:frontend (exit 0)npm run test:currency (exit 0: currency.test.ts 18/18, country-profile.test.ts 2/2, locale-iran.test.ts 30/30, regional-snapshot, split-checks, minor-units, reset, currency-print-fallback 17 counted / 0 failed)npm run test:country-localization (exit 0)npm run test:browser-receipts (exit 0)npm run test:issue-266-currency-symbol-print (exit 0: 24/24 passed)npm run test:cart-price-override (exit 0)Live Chromium Playwright + isolated FloCafe server validation suite (task-275, exit 0, ALL LIVE SCENARIOS PASSED)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.