You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[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
Click on plus and complete request money flow using any amount and any user
Change language to spanish
Open report to which we have requested money in step 2
Copy IOU message of request money and paste anywhere to observe that it is translated correctly
Click on IOU message and click on copy to clipboard on similar IOU message
Paste and observe that it is not translated
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?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
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
changed the title [-]Web - Inconsistency bug: App does not translate copy to clipboard text for requested (works fine for owes)[/-][+][$500] Web - Inconsistency bug: App does not translate copy to clipboard text for requested (works fine for owes)[/+]on Sep 10, 2023
iouMessage=`requested ${amount}${comment&&` for ${comment}`}`;
break;
caseCONST.IOU.REPORT_ACTION_TYPE.SPLIT:
iouMessage=`split ${amount}${comment&&` for ${comment}`}`;
break;
caseCONST.IOU.REPORT_ACTION_TYPE.DELETE:
iouMessage=`deleted the ${amount} request${comment&&` for ${comment}`}`;
break;
caseCONST.IOU.REPORT_ACTION_TYPE.PAY:
iouMessage=isSettlingUp ? `paid ${amount}${paymentMethodMessage}` : `sent ${amount}${comment&&` for ${comment}`}${paymentMethodMessage}`;
break;
default:
break;
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 en.js and es.js and should be used using Localize.translateLocal, for example we should move the following to en.js & es.js and make it a function to accept required arguments to use like payerOwesAmount
Please 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:
However, for requested money actions in the format requested %currency% %amount% for %comment% we are obtaining the message directly from the Onyx data here:
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: requested %currency% %amount% for %comment% using Localize.translateLocal
Here's the proposed code change:
The PR that introduced the bug has been identified. Link to the PR - current PR is more for missing functionality rather than regression fix
The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment - N/A
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion - N/A
Determine if we should create a regression test for this bug - N/A
Activity
[-]Web - Inconsistency bug: App does not translate copy to clipboard text for requested (works fine for owes)[/-][+][$500] Web - Inconsistency bug: App does not translate copy to clipboard text for requested (works fine for owes)[/+]melvin-bot commentedon Sep 10, 2023
Job added to Upwork: https://www.upwork.com/jobs/~014fa137d31ebe2c21
melvin-bot commentedon Sep 10, 2023
Triggered auto assignment to @maddylewis (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Sep 10, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Sep 10, 2023
Triggered auto assignment to @conorpendergrast (
External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.melvin-bot commentedon Sep 10, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @narefyev91 (
External)getusha commentedon Sep 10, 2023
Proposal
Please 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?
App/src/libs/ReportUtils.js
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
en.jsandes.jsand should be used usingLocalize.translateLocal, for example we should move the following to en.js & es.js and make it a function to accept required arguments to use likepayerOwesAmountApp/src/libs/ReportUtils.js
Line 2028 in fd043aa
Will be something like
and will be used using the following
App/src/languages/en.ts
Line 512 in 1400608
What alternative solutions did you explore? (Optional)
rayane-d commentedon Sep 10, 2023
Proposal
Please 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:
we are getting
%user% owes %amount%message here:App/src/pages/home/report/ContextMenu/ContextMenuActions.js
Lines 195 to 198 in 1400608
In the language file, the translation is defined as follows:
App/src/libs/ReportUtils.js
Line 1264 in 1400608
App/src/languages/en.ts
Line 512 in 1400608
However, for requested money actions in the format
requested %currency% %amount% for %comment%we are obtaining the message directly from the Onyx data here: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:
requested %currency% %amount% for %comment%using Localize.translateLocalHere's the proposed code change:
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:
Ensure that a similar translation is added for the Spanish language.
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)
66 remaining items
maddylewis commentedon Oct 12, 2023
yes! i will process payments / post an updated payment summary before EOD!
rayane-d commentedon Oct 12, 2023
Friendly reminder @maddylewis
maddylewis commentedon Oct 13, 2023
Payments
Contributor hired on 9/11. PR merged on 9/26.
maddylewis commentedon Oct 13, 2023
@narefyev91 - will you please review/fill out this checklist when you have a chance? thanks! #27114 (comment)
maddylewis commentedon Oct 13, 2023
offers sent to @dhanashree-sawant and @rayane-djouah
https://www.upwork.com/ab/applicants/1712902083964887040/offers
rayane-d commentedon Oct 13, 2023
Offer accepted @maddylewis
JmillsExpensify commentedon Oct 13, 2023
$500 payment approved for @mananjadhav based on BZ summary.
narefyev91 commentedon Oct 16, 2023