Add IRR currency and improve Persian (fa-IR) support#4312
Conversation
|
@mamal72 is attempting to deploy a commit to the Umami Software Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR adds IRR (Iranian Rial) to the supported currencies list, fills in 12 missing Persian (fa-IR) translation keys, and refactors how the HTML
Confidence Score: 5/5Safe to merge — the translation additions and IRR currency entry are straightforward, and removing the #__next dir assignment is a correct cleanup. The new useEffect in useLocale is redundant but not harmful. All three changed files make isolated, low-risk additions: JSON translation keys, a constant entry, and a client-side DOM side-effect hook. No data paths, APIs, or server-side logic are touched. The duplicate lang/dir effect in useLocale is overwritten by the existing MessagesProvider effect on every render, so the final observable behavior is unchanged from before this PR. No files require special attention; the redundant effect in useLocale.ts is worth cleaning up but does not affect correctness. Important Files Changed
Sequence DiagramsequenceDiagram
participant Store as Zustand Store
participant ML as useLocale (any component)
participant MP as MessagesProvider (Providers.tsx)
participant DOM as document.documentElement
Note over Store: locale changes (e.g. fa-IR)
Store->>ML: locale update (all subscribers)
Store->>MP: locale update
Note over ML,MP: React commit phase — child effects first
ML->>DOM: "lang = "fa" (split('-')[0])"
ML->>DOM: "dir = "rtl""
Note over MP: MessagesProvider effect runs after
MP->>DOM: "lang = "fa-IR" (full locale) ← overwrites"
MP->>DOM: "dir = "rtl""
Reviews (2): Last reviewed commit: "Improve Persian (fa-IR) support" | Re-trigger Greptile |
13d5530 to
464e99c
Compare
- Add 12 missing translation keys to fa-IR.json - Set lang and dir on document.documentElement via useEffect on locale change, fixing the hardcoded lang="en" and ensuring both attributes are on the same element and applied on initial load
464e99c to
b077714
Compare
Summary
board-type,open,replay-code,save-replay,select-link,select-pixel,customers,orders,saved,upgrade,select-board-entity-first,upgrade-required)langanddirondocument.documentElementviauseEffecton locale change, so the HTMLlangattribute reflects the active language on every render (including initial load) and both attributes live on the same<html>elementTest plan
lang="fa"anddir="rtl"are set on<html>