-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace the existing US-located numbers, date and amounts with locale-aware components/ methods #2349
Comments
Sorry, what's HOA? Also, can you provide a list of places you'll update? |
A thousand apologies HOC, the corrector corrected me wrong, do I make a list with all the files that are going to be corrected? |
Yeah, you can link to every text/file that will need updating |
Mainly I was asking for the list to make sure we are not missing any place to update and that you are not on the hook for any new place we use numbers/dates/amounts that get added after your PR is over. |
That line is not rendering the amount, so that would not be the place to localize it, it would be here |
@Andmat7 I see you deleted several of your comments, any reason why? If you want to work on this, please re-post here your proposal. |
Watch out because the amounts examples are not quite correct. When we are dealing with a money amount, we need to format it as so by passing the
Good question, I think that on login we should not do anything, but I think it would be nice if we allowed you to for example start a new chat with a phone number by only typing the number without the international prefix and then calling
Yes Proposal looks good, @jboniface can you go ahead and hire @parasharrajat in upwork? |
@iwiznia I checked it when posting the proposal but Actually, we render the Sign separately https://github.com/Expensify/Expensify.cash/blob/9fbf82e8237b7d1ff416619970038cc0d5bf9252/src/pages/iou/steps/IOUAmountPage.js#L104. So we just need to convert the amount. But we can find the best possible things after changes as I think I would be needing some feedback while working over this issue. |
hmmmmm and can't we transform that to be just one component? |
Yeah. That's one of the Ideas as for some of the locales currency sign is shown after the amount. Let's look at these changes while reviewing the PR to be exact. |
Yeah, exactly, Intl.numberFormat (which is what our numberFormat uses) handles those cases and puts the currency after/before the number based on the locale. |
@parasharrajat what is the status of this? |
@iwiznia Sorry for delay on this. I will add the PR today. |
@iwiznia Question:
|
hmmmm the currency should be in the report stored in Onyx, so I guess you can use |
Not sure what is the data structure for that and how that works so it's hard to imagine. If you can lead me to any docs on IOU, I can better understand the amount used on different components under different contexts. let me check this. Thanks. |
All reports have the same data structure, which is generated by getSimplifiedReportObject. The IOUs in particular are set here and here |
@iwiznia Here on LHN. Do I need to remove the country code from the There are a couple of other places where we show phone numbers like this. I saw that for
|
Yep
You need to use the locale aware method. If you are using the withLocalize HOC, then it would be: |
Questions:
This makes me wonder that there are very few places we need to convert numbers and amounts. And we need to revise the list once more. |
The idea behind the toLocalPhone is to not see the country code of phones in your location. So if I am in USA I would not see all US phones prefixed with +1 but I would see all the non US phones with their prefix. Or in other words, if a phone does not have a prefix, it's because it's in your own country. |
Gotcha. Adding now. Then I will add you on the PR to review. |
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 thewithLocalize
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
The text was updated successfully, but these errors were encountered: