-
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
Fix Required Receipt Translations #44220
Fix Required Receipt Translations #44220
Conversation
@ahmedGaber93 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
I also modified the spanish translations to match the table here #33969 (comment) Output: ![]() ![]() |
Reviewer Checklist
Screenshots/Videos |
@abzokhattab Do you have any idea why the expected behavior here not mention category name on the Spanish translation while mention it on English translation |
Asking here #33969 (comment) |
src/languages/en.ts
Outdated
@@ -3181,7 +3181,9 @@ export default { | |||
overLimitAttendee: ({formattedLimit}: ViolationsOverLimitParams) => `Amount over ${formattedLimit}/person limit`, | |||
perDayLimit: ({formattedLimit}: ViolationsPerDayLimitParams) => `Amount over daily ${formattedLimit}/person category limit`, | |||
receiptNotSmartScanned: 'Receipt not verified. Please confirm accuracy.', | |||
receiptRequired: (params: ViolationsReceiptRequiredParams) => `Receipt required${params ? ` over ${params.formattedLimit}${params.category ? ' category limit' : ''}` : ''}`, | |||
receiptRequired: ({formattedLimit, category}: ViolationsReceiptRequiredParams) => | |||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we write this as a function with if/elses to make it more readable and not need to suppress this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this was resolved, but the lint suppression is still there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This point was resolved .. I refactored the receiptRequired
to be more readable instead of the one line function. let me know if there is another issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we should remove // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh i see .. but typescript still complains if i remove the suppression line:
FYI here is the discussion where we decided to use ||
instead of ??
please let me know what you think and how we should proceed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you can explicitly check if they are undefined? Since it seems like they can either be strings or undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it seems like they can either be strings or undefined.
If that, ??
will be good enough to check undefined values, we can use it and remove lint suppression. @abzokhattab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted to ??
@abzokhattab We need to remove the category name from translations based on this #33969 (comment). We exactly need to remove it from English translation, Spanish translation already don't have category name. |
Okay i refactored the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just need to remove the empty lines here
Co-authored-by: ahmedGaber93 <[email protected]>
Co-authored-by: ahmedGaber93 <[email protected]>
Co-authored-by: ahmedGaber93 <[email protected]>
Co-authored-by: ahmedGaber93 <[email protected]>
Co-authored-by: ahmedGaber93 <[email protected]>
Co-authored-by: ahmedGaber93 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@puneetlath
|
src/languages/en.ts
Outdated
@@ -3181,7 +3181,9 @@ export default { | |||
overLimitAttendee: ({formattedLimit}: ViolationsOverLimitParams) => `Amount over ${formattedLimit}/person limit`, | |||
perDayLimit: ({formattedLimit}: ViolationsPerDayLimitParams) => `Amount over daily ${formattedLimit}/person category limit`, | |||
receiptNotSmartScanned: 'Receipt not verified. Please confirm accuracy.', | |||
receiptRequired: (params: ViolationsReceiptRequiredParams) => `Receipt required${params ? ` over ${params.formattedLimit}${params.category ? ' category limit' : ''}` : ''}`, | |||
receiptRequired: ({formattedLimit, category}: ViolationsReceiptRequiredParams) => | |||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this was resolved, but the lint suppression is still there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good with me. @cead22 you?
✋ 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/cead22 in version: 9.0.4-0 🚀
|
🚀 Cherry-picked to staging by https://github.com/tgolen in version: 9.0.4-5 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.5-13 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.6-8 🚀
|
Details
Fixed Issues
$ #43939
PROPOSAL: #43939 (comment)
Tests
Precondition : As a admin set up expense violation as " Receipt required amount" to "0" in OldDot control policy
Offline tests
Same as tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop