Replace the existing US-located numbers, date and amounts with locale-aware components/ methods
See original GitHub issueIf you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
We are implementing the structure for internationalisation and localisation in Expensify.Cash.
As part of that, we need to replace the existing US-located numbers, dates, amounts and phone numbers with locale-aware components/ methods. In order to do that, you need to identify all places that display any of that information and then use the methods numberFormat
, timestampToRelative
, timestampToDateTime
, toLocalPhone
, fromLocalPhone
of the withLocalize
HOC we added here.
Expected Result:
numbers, dates, and amounts should be locale-aware
Actual Result:
They are US centric
Platform:
All
Version Number: current https://github.com/Expensify/Expensify/issues/152154
Job on Upwork
view Upwork job here
Issue Analytics
- State:
- Created 2 years ago
- Comments:23 (22 by maintainers)
Top GitHub Comments
Yep
You need to use the locale aware method. If you are using the withLocalize HOC, then it would be:
this.props.numberFormat(props.iouReport.total / 100, {type: 'currency', currency: props.iouReport.currency})
All reports have the same data structure, which is generated by getSimplifiedReportObject. The IOUs in particular are set here and here