[NoQA] Safely catch translation key when it's wrong or missing#28377
[NoQA] Safely catch translation key when it's wrong or missing#28377mountiny merged 8 commits intoExpensify:mainfrom
Conversation
|
@lakchote Wrong assigned. Please ignore this PR |
|
I dont think we have to worry about the API fallback now, we do not have the violations in place right now so I think we can just proceed with what we have now. Did I miss anything? |
|
@mountiny When you mentioned:
Does that mean we can leave out test steps and screenshots for this PR? If it does, I think we could continue reviewing the PR |
|
@dukenv0307 Lets test this by hardcoding different than Expensify domain and then hardcoding wrong translation to see it works fine |
|
@mountiny @robertKozik I just updated the test steps and screenshots. Please help review when you have time. |
|
@robertKozik Friendly bump. Please help review the PR |
| let userEmail = ''; | ||
| Onyx.connect({ | ||
| key: ONYXKEYS.SESSION, | ||
| waitForCollectionCallback: true, | ||
| callback: (val) => { | ||
| if (!val) { | ||
| return; | ||
| } | ||
| userEmail = val.email; | ||
| }, | ||
| }); |
There was a problem hiding this comment.
I think we can create some comment to address why are we need user email here - similar to LocaleListener.connect() comment below
src/CONST.ts
Outdated
| RECEIPTS: 'receipts@expensify.com', | ||
| STUDENT_AMBASSADOR: 'studentambassadors@expensify.com', | ||
| SVFG: 'svfg@expensify.com', | ||
| EXPENSIFY_EMAIL_DOMAIN: '@expensify', |
There was a problem hiding this comment.
| EXPENSIFY_EMAIL_DOMAIN: '@expensify', | |
| EXPENSIFY_EMAIL_DOMAIN: '@expensify.com', |
If you have an phone number as your primary contact method the userEmail gets format : <phone_number>@expensify.sms so we need to specify top-level domain as well.
robertKozik
left a comment
There was a problem hiding this comment.
One change in comment, so it will be more descriptive. I'll start doing reviewer checklist now.
src/libs/Localize/index.js
Outdated
| import BaseLocaleListener from './LocaleListener/BaseLocaleListener'; | ||
| import ONYXKEYS from '../../ONYXKEYS'; | ||
|
|
||
| // Save the email after user logins |
There was a problem hiding this comment.
| // Save the email after user logins | |
| // Current user mail is needed for handling missing translations |
Reviewer Checklist
Screenshots/VideosWebweb.mov |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.80-0 🚀
|
|
@mountiny is this internal QA? |
|
Yeah I will check this off |
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.80-3 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.81-0 🚀
|
|
PR caused this weird confusing thing to happen here -> #28312 (comment) |
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
2 similar comments
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.84-10 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.84-10 🚀
|
| let userEmail = ''; | ||
| Onyx.connect({ | ||
| key: ONYXKEYS.SESSION, | ||
| waitForCollectionCallback: true, |
There was a problem hiding this comment.
@dukenv0307 SESSION onyx key is not a collection key, I'm wondering why waitForCollectionCallback: true was added?
There was a problem hiding this comment.
That was probably a bad copy pasta we have missed
There was a problem hiding this comment.
Np, we will remove it in a TS migration PR 👍



Details
Fixed Issues
$ #27759
PROPOSAL: #27759 (comment)
Tests
Testing in dev env
For example: Update this common.settings in this line to 'wrong'
Offline tests
QA Steps
Testing in dev env
For example: Update this common.settings in this line to 'wrong'
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
web.4.mp4
Mobile Web - Chrome
chrome.mov
Mobile Web - Safari
safari.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov