ledger-live-mobile icon indicating copy to clipboard operation
ledger-live-mobile copied to clipboard

Regions v3 regression, Intl polyfill

Open ofreyssinet-ledger opened this issue 2 years ago • 0 comments

  • [x] Put region settings back in the general settings UI.
  • [x] Reimplement of "searchable" list in makeGenericSelectScreen.tsx, this was a regression of v3 as it was implemented in the .js version already.
  • [x] Fix regression in components using the incorrect locale (things that were implemented in V2 but not in V3 components), used this PR as a base #1941.
  • [x] Fix remaining incorrect uses of useLocale() when doing number/date formatting (instead, using localeSelector), see following point for explanation.
  • [x] Rename useLocale() (in Locale.js) to useTranslationLocale() & document it to avoid confusions & uses in wrong context (it should be used only for handling translatable content, not for number & date formatting).
  • [x] Ensure Intl polyfill (for Hermes) are imported and working for all selectable regions. (with a small patch to avoid this issue https://github.com/formatjs/formatjs/issues/3503)
  • [ ] ⚠️ DX is bad because importing all locale data at each reload takes very long
  • [ ] Need to revert this change in live-common https://github.com/LedgerHQ/ledger-live-common/commit/6b9efb53f793397d71010d3db6876867f327d7f4 as it prevents formatting of currency (it would work without this change thanks to the polyfill)

Type

Bug fix

Context

Parts of the app affected / Test plan

ofreyssinet-ledger avatar Mar 24 '22 15:03 ofreyssinet-ledger