-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Apply localization to all hard coded text in the Expensify.cash app #2408
Comments
Posted to Upwork (job link in GH body) and awaiting proposals. |
Proposal
QuestionAm I correct in thinking that all of the files that need localization are contained in "components" and "pages" directories? |
Not every component, just every component that displays hardcoded english text.
Don't do this, we are not translating the app to spanish yet (or any other language) but also we don't want to leave garbage in the translation files.
Huh? Why? That's not how you use the higher order component, its usage is similar to the
Just to clarify, what you pass to the translate method is not the full english text, but the key to the translation.
Yes, I think that's correct. |
Got it, thank you for clarification
My bad, I confused HOC with hook. I remember being slightly confused seeing withLocalize in "components" directory, thinking it was a hook. I got it now. I also see the "compose" function from redux. |
Can you list out the places we will update? After reviewing that I will approve your proposal. |
Here is the list of components that need to be updated:
I have another question: what should we do with the text labels in defaultProps or in variables set outside of the react components? These won't be able to use 'translate' function. Should i move all of the default props and constants inside the corresponding react componets? |
Some of those don't seem to have any hardcoded text:
I don't see
Great question! I think what you need to do there is basically move the translation to the render method. So, for example here you would:
That way the translation is moved from initialization to the render method and it can get updated whenever the locale changes. |
TextInputFocusable - lines 182, 190
Yes, exactly. Component with dislay name 'InitialSettingsPage' inside the src/pages/settings/InitialPage.js
Yes, it makes perfect sense. Thank you for clarification P.S. |
Oh, sorry about that. You are right about all those having texts, I missed it. The only one I am having doubts is this one, is that actually printed in screen for the user to see?
Yeah, for those you will need to subscribe to the PREFERRED_LOCALE onyx key and call the translate method directly. @michaelhaxhiu go ahead and hire @eVoloshchak in upwork. |
These should be used somewhere in any component and I think you can call the |
@eVoloshchak Hired you on Upwork for the job, and assigned you to this GH. ✅ Feel free to begin drafting a PR for the proposed solution. Given that this is your first time working on an Expensify.cash job, I wanted to highlight the [Contributor Guidelines] |
I think that won't work since we will have the text, not the key. |
so can't we set the key as CONST values and thus they would be passed down.
|
True, maybe that's better. |
Judging by the source code it is visible to user on the screen, but I will have to double check when I actually launch the application.
Starting to work on the PR, thank you for the guidelines
Got it |
@eVoloshchak how's the PR coming along so far? Feel free to provide daily updates as you go so that we can have a gauge of your progress. |
I have applied localization to a majority of components/pages, I have 4 of them left to be translated. I expect to finish them in a couple of hours, after that i will start testing on different platforms/devices. If tests are successfull, I'll submit a PR today. |
I reverted the PR (left a comment in the PR itself) |
I've resolved some issues with the PR, but I still have a couple of questions. I've asked them here: #2562 |
What is the latest on this one? I see the PR is merged. Is there another outstanding PR? |
@michaelhaxhiu we reverted the PR ad @eVoloshchak was waiting on some answers from me which they did not get till today since I was OOO. |
@eVoloshchak can you confirm you are working on this? |
Yes, I'm working on this, planning to submit a PR in a couple of hours. P.S: submitted a new PR. |
Nice work @eVoloshchak, looks like that PR is still being reviewed right now. I'll check back in on this later today to see if we've finalized all comments and merged. |
Hi @eVoloshchak, I think this PR has caused a regression with the IOU Modal, but this wasn't possible for you to test, so no worries 🙂 I'm seeing a crash here which doesn't occur on previous commits:
As the feature is currently behind a beta, you must perform the following change to reproduce the issue. Either navigate to Permissions.js, comment out this line and return true -- or apply this diff.txt with |
Re-opening this GH until the regression is fixed, which @Julesssss linked above. |
There's also this other error: |
I am unsure if this change is what caused this, I think it did not. |
I have fixed the error with addSecondaryLoginPage.password, ready to submit a PR. |
Yep and assign me for review
Nope, someone else is handling it, so no need. |
I'm not sure that I can assign reviewers for my commit, couldn't find it anywhere. Isn't it available only to the owner of the repository? |
You can't add a reviewer? Odd.. anyway, I see the PR above, so reviewing it now. |
Reopening since a couple of issues were found |
How long ago were the issues found @iwiznia? This contributor has already been compensated for the job and so I'm thinking it may be better to open a fresh GH. |
I know that we already paid, but the issues were there since the beginning and I expect @eVoloshchak to fix them. |
Ah, I understand! Ok let's keep this GH going in that case 👍 |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Upwork job - https://www.upwork.com/jobs/~01ad599888651ad174
Expected Result:
We are looking to apply localization to the Expensify.cash app, so that all hard coded text is replaced with locale-aware components/ methods. This project will require (1) Identifying all places that display hardcoded texts in the app, and (2) Using the
withLocalize
HOC in this PR #2208 to make all those texts support localized versions.Actual Result:
Today, all text in the Expensify.cash app is hardcoded in English. Here are a few examples for reference:
Platform:
This should apply to all platforms listed:
Expensify/Expensify Issue URL: https://github.com/Expensify/Expensify/issues/152153
Other considerations:
There may be a few areas where it doesn't make sense to translate hardcoded text, which are important to highlight as a part of this project. For example, we should not update the hard corded text found here:
The text was updated successfully, but these errors were encountered: