fix: use user's fiat currency and locale settings consistently#68
Open
BitHighlander wants to merge 2 commits intodevelopfrom
Open
fix: use user's fiat currency and locale settings consistently#68BitHighlander wants to merge 2 commits intodevelopfrom
BitHighlander wants to merge 2 commits intodevelopfrom
Conversation
Replace all hardcoded USD/en-US formatting with the user's chosen currency and locale from FiatProvider. Removes legacy formatUsd(), updates AnimatedUsd to use fiat symbol, fixes i18n strings that hardcoded "$0.00 USD", and adds browser language auto-detection on first launch.
…review restored 1. Reports: stored values are USD — keep USD currency label, only use user's number_locale for digit separators (no relabeling bug). 2. AnimatedUsd: replace brittle separator guessing with CountUp's formattingFn backed by Intl.NumberFormat. Correctly handles fr-FR spaces, pl-PL suffix symbols, de-CH apostrophes, and 0-decimal currencies (JPY/KRW/HUF). 3. SendForm: zero preview now falls back to fmt(0) instead of fmtCompact(0) which returns '' for zero values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$/USD/en-USformatting with the user's chosen currency and locale fromFiatProviderformatUsd()function — all 10+ call sites now useuseFiat().fmtCompact()AnimatedUsdcomponent to derive symbol and separators from fiat context instead of hardcoding$and,asset.jsonlocale files:"$0.00 USD ({{count}})"→"{{zeroValue}} ({{count}})"staking.jsonlocale files:~${{usd}}→~{{fiatValue}}navigator.language→ supported language match)number_localeandfiat_currencysettings instead of hardcodeden-USZcashPrivacyTabblock numbers use user's locale for thousand separatorsReportDialogdates and totals use user's localeFiles changed (38)
formatUsd()fromformatting.tsAnimatedUsd,SendForm,AssetPage,SwapDialog,BtcXpubSelector,EvmAddressSelector,StakingPanel,ZcashPrivacyTab,ReportDialogreports.ts,swap-report.tsasset.json+ 10staking.jsonlocale filesi18n/index.ts(browser locale detection)Test plan