-
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
[HOLD for payment 2023-10-09] [HOLD for payment 2023-09-29] [$500] Web - Inconsistency bug: App does not translate copy to clipboard text for requested (works fine for owes) #27114
Comments
Job added to Upwork: https://www.upwork.com/jobs/~014fa137d31ebe2c21 |
Triggered auto assignment to @maddylewis ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to @conorpendergrast ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @narefyev91 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.copy clipboard text for requested is not translated according to preferences. What is the root cause of that problem?Lines 2023 to 2040 in fd043aa
We have hard coded text which will not be translated dynamically depending on the user language selection. What changes do you think we should make in order to solve the problem?Such texts should be put inside Line 2028 in fd043aa
Will be something like requestedAmount: ({amount, comment}) => `requested ${amount}${comment && ` for ${comment}`}` and will be used using the following Localize.translateLocal('iou.requestedAmount', {payer: comment, amount: formattedAmount}) Line 512 in 1400608
What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.The problem we are addressing is that the app does not translate copy-to-clipboard text for requested money actions, although it works fine for IOUs. What is the root cause of that problem?The root cause of this issue lies in how we are retrieving and handling the copy-to-clipboard message in the context menu action located in the following here: App/src/pages/home/report/ContextMenu/ContextMenuActions.js Lines 171 to 219 in 1400608
In the case of IOUs (user owes amount), the message is properly translated: App/src/pages/home/report/ContextMenu/ContextMenuActions.js Lines 195 to 198 in 1400608
In the language file, the translation is defined as follows: Line 1264 in 1400608
Line 512 in 1400608
However, for requested money actions in the format App/src/pages/home/report/ContextMenu/ContextMenuActions.js Lines 202 to 210 in 1400608
What changes do you think we should make in order to solve the problem?To resolve this issue, we should modify the copy-to-clipboard context menu action here to include a case for money request actions. We should extract the amount and currency of the request from the Onyx data and create the translated message in the format: else if (ReportActionsUtils.isMoneyRequestAction(reportAction)) {
const transaction = TransactionUtils.getTransaction(originalMessage.IOUTransactionID);
const {amount, currency, comment} = ReportUtils.getTransactionDetails(transaction);
const formattedAmount = CurrencyUtils.convertToDisplayString(amount, currency);
const displaymessage = Localize.translateLocal('iou.requestedAmount', {
formattedAmount,
comment,
});
Clipboard.setString(displaymessage);
} Additionally, we need to add the translation for this message in the language files (e.g., en.ts and Spanish). In the translation file (en.ts), add the following translation: requestedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `requested ${formattedAmount}${comment ? ` for ${comment}` : ''}`, Ensure that a similar translation is added for the Spanish language. requestedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `solicité ${formattedAmount}${comment ? ` para ${comment}` : ''}`, By making these code changes and adding translations, we will be able to properly translate and copy-to-clipboard the requested money action messages. What alternative solutions did you explore? (Optional) |
Proposal from @getusha looks good to me #27114 (comment) |
Triggered auto assignment to @roryabraham, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@narefyev91 this proposal will not fix the translation issue dynamically – it will persist the message with the language that was set at the moment of IOU request creation – please see the broader issue with copying the IOU to the clipboard: #26664 This my proposal should fix the issue dynamically (with copying in the locale that's chosen for the user at the moment, not only during creation): #26664 (comment) |
Hey @paultsimura ! Proposal indicates the root case and add logic for pick translation from languages file instead of applying it as it is now. All code changes should be discussed in PR |
@narefyev91 of course, I did not want to dive deep into code changes. |
@paultsimura it's obvious after we change the hard coded values to dynamic in |
@maddylewis Looks like we both got assigned. Unassigning myself as I'm going on parental leave! |
@getusha sometimes obvious things are not that obvious. I'm not trying to steal your bounty, moreover my issue was closed as a dupe. |
@paultsimura i understand your concern but as i mentioned the localization will be used every place where it should be wherever the Money Request action exists. Screen.Recording.2023-09-11.at.11.48.43.AM.mov |
@getusha The only places where Furthermore it's not dynamic as others have said. I think @rayane-djouah's proposal looks good. |
@narefyev91, @maddylewis, @roryabraham, @rayane-djouah Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@roryabraham - did this bug fix cause a regression? #27114 (comment) just want to confirm while i process payment / if it should be reduced by 50% for the contributor and C+ assigned to the issue. |
Payments
|
@narefyev91 - will you review this checklist when you have a chance? thanks! #27114 (comment) |
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.75-12 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-10-09. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
@maddylewis @mountiny I had helped with the review of the PR |
@maddylewis Can you please post the payment summary here so that I can request the payout? |
yes! i will process payments / post an updated payment summary before EOD! |
Friendly reminder @maddylewis |
Payments
Contributor hired on 9/11. PR merged on 9/26. |
@narefyev91 - will you please review/fill out this checklist when you have a chance? thanks! #27114 (comment) |
Offer accepted @maddylewis |
$500 payment approved for @mananjadhav based on BZ summary. |
|
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
App should translate IOU message copy to clipboard text for 'requested' message as we do for similar IOU parent message
Actual Result:
App does not translate IOU message copy to clipboard text for 'requested' message IOU which we find on click of request money IOU in main report
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.66.3
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
translation.copy.to.clipboard.for.inner.IOU.mp4
Recording.4371.mp4
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693925728595269
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: