question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replace the existing US-located numbers, date and amounts with locale-aware components/ methods

See original GitHub issue

If 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:closed
  • Created 2 years ago
  • Comments:23 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
iwizniacommented, May 20, 2021

There are a couple of other places where we show phone numbers like this. In general, do I need to remove the country code from all the places where the phone number is visible?

Yep

Num.numberformat is important as we receive the amount of 1000 for $10 from the backend and it will give us a string like $10.00.We can’t pass that string to localized numberFormat How should I handle this amount to use in localized NumberFormat.

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})

1reaction
iwizniacommented, May 19, 2021

All reports have the same data structure, which is generated by getSimplifiedReportObject. The IOUs in particular are set here and here

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling Lifecycles with Lifecycle-Aware Components
Lifecycle-aware components perform actions in response to a change in the lifecycle status of another component, such as activities and ...
Read more >
Types of fields and field data - Dynamics 365 - Microsoft Learn
Learn about the difference between simple, calculated, and rollup fields. Field data can include lines of text, currency, dates and times, ...
Read more >
Unicode Locale Data Markup Language (LDML)
In general terms, the locale id is a parameter that is supplied to a particular service (date formatting, sorting, spell-checking, and so on)....
Read more >
CSL 1.0.2 Specification
Date Ranges. AD and BC; Seasons; Approximate Dates. Number; Names. Name. Name-part Order; Name-part Formatting. Et-al; Substitute; Label in cs:names.
Read more >
Renderers - DataTables
columns.render can be utilised in a number of different ways: ... DataTable.render.datetime() // Display a locale aware date / time from an ISO-8601...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found