Closed kbecciv closed 10 months ago
Triggered auto assignment to @johncschuster (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)Please restate the problem that we are trying to solve in this issue. When room name is changed, and language changed to Spanish, the text room name changed to new room name is not translated into Spanish.
Here alternativeText
is not translated.
Translate the phrase from backend and send. Or we can have an ES phrase for Room name changed to
and append it to the new text of the room to get the translated phrase.
None
When the language is changed to Spanish, the text in the LHN is still in English.
We are using the last message in the LHN which comes from the backend and just says "Room renamed to..."
Instead of displaying the last message, we should simply use the existing translation key (newRoomPage.renamedRoomAction
) that we use for displaying the renamedRoom message in the chat, this way the text in the LHN will match the text in the chat.
This can be implemented in SidebarUtils by getting the required data from visibleReportActionItems
and checking if the last reportAction was of the type RENAMED
before assigning alternateText
with the translation.
Something like:
const lastAction = visibleReportActionItems[report.reportID]
if (lastAction) {
const oldName = lodashGet(lastAction, 'originalMessage.oldName', '');
const newName = lodashGet(lastAction, 'originalMessage.newName', '');
const lastActorDisplayName = lodashGet(visibleReportActionItems[report.reportID], 'person[0].text');
if (lastAction.actionName && lastAction.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED) {
result.alternateText = lastActorDisplayName + Localize.translate(preferredLocale, 'newRoomPage.renamedRoomAction', {oldName, newName})
}
}
None
Job added to Upwork: https://www.upwork.com/jobs/~01b9817b9e53ecc2b4
Current assignee @johncschuster is eligible for the External assigner, not assigning anyone new.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (External
)
Triggered auto assignment to @neil-marcellini (External
), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Not overdue melvin now only came external
Contributor details Your Expensify account email: javsfdev323@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~01b7fc496875b2b3dd
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Room - Room name rename text is translated in chat but not translated to Spanish in LHN has context menu
The alternateText
is coming directly from backend and we are displaying it as it is without translating.
We can create two variables inside es.js
and en.js
respectively.
Here In es.js
roomRenamedTo: 'Sala renombrada a '
and here in en.js
roomRenamedTo: 'Room renamed to ',
Instead of displaying the backend message directly, We can check the last action is equal to rename here then on the basis of that we can use the above localize variable to display the correct translated message.
Updated code :
const reportName = ReportUtils.getReportName(report);
const lastAction = visibleReportActionItems[report.reportID];
if (lastAction && lastAction.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED) {
result.alternateText = Localize.translate(preferredLocale, 'report.roomRenamedTo') + reportName;
}
Note: As we need reportName
in our updated code that's why we moved this line to few line-up.
Here is the sample video of the solution :
https://github.com/Expensify/App/assets/98891986/94aea8e0-cb8a-47fb-a9d2-1a11a3a5b74c
NA
I like @Ollyws proposal here - https://github.com/Expensify/App/issues/20124#issuecomment-1575153551 It similar to how we translate for archived rooms. Sameways we show the original message in the chat list by translating - https://github.com/Expensify/App/blob/main/src/components/ReportActionItem/RenameAction.js#L24
We should do the same for LHN as well.
One suggestion is, its fine to just show Room renamed to
in english the same way as now and its translated string in spanish and not use the big string in the chat renamed this room from ${oldName} to ${newName}
since LHN is a small space.
🎀👀🎀 C+ Reviewed
cc: @neil-marcellini
I like @Ollyws proposal here - #20124 (comment) It similar to how we translate for archived rooms. Sameways we show the original message in the chat list by translating - https://github.com/Expensify/App/blob/main/src/components/ReportActionItem/RenameAction.js#L24
We should do the same for LHN as well.
One suggestion is, its fine to just show
Room renamed to
in english the same way as now and its translated string in spanish and not use the big string in the chatrenamed this room from ${oldName} to ${newName}
since LHN is a small space.🎀👀🎀 C+ Reviewed
cc: @neil-marcellini
@abdulrahuman5196 the suggestion that you have given is covered in this #20124 (comment), like added translated strings in the respective language file and using the same to display the text in the selected language. can you please relook at this proposal?
@kamaljitSharma21 Thank your for the proposal. I did check your proposal before approving here. It only a minor suggestion/variation which could have easily changed in PR.
I agree with @abdulrahuman5196's decision that @Ollyws' proposal https://github.com/Expensify/App/issues/20124#issuecomment-1575153551 looks best. I think it might need some small tweaks but we'll handle that in the PR.
📣 @Ollyws You have been assigned to this job by @neil-marcellini! Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Keep in mind: Code of Conduct | Contributing 📖
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀
Although as Melvin says, it took 4 days we did have it ready and approved within the three days. It would be great if this could be taken into consideration.
I approved and merged at the same time though 🤔. Anyways I did request some changes because I missed the fact that we were also fixing another issue here, so ultimately I slowed this down by a day.
I think we should give @Ollyws the bonus 😄
Thanks, @neil-marcellini! I'll make sure the bonus is included 👍
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.28-5 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-06-23. :confetti_ball:
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.
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:
BZ checklist:
The PR that introduced the bug has been identified. Link to the PR: 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: 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:
Not a regression. But the implementation was not done until now.
Determine if we should create a regression test for this bug. If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
No. I don't think a regression test would be beneficial for this minor translation issue.
Not overdue, gentle bump @johncschuster
@dhanashree-sawant / @Ollyws / @abdulrahuman5196 can you please apply to the Upwork job, here? I'll get payment issued shortly!
Thank you. Applied for the upwork job @johncschuster
@johncschuster Also applied. Thanks!
Great! I've extended offers to you both!
@johncschuster Accepted, thanks!
Payment has been issued to @Ollyws and @abdulrahuman5196 🎉
I still need to pay @dhanashree-sawant before closing the issue.
Hi @johncschuster, Thank you. Applied for the upwork job
All payments have been issued! 🎉
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
App should translate LHN text for room rename to Spanish as it does for text in chat
Actual Result:
App translates room rename text in chat but does not translate room rename text in LHN
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.23.6
Reproducible in staging?: yes
Reproducible in production?: yes
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
https://github.com/Expensify/App/assets/93399543/91a88295-8fb2-4988-a4b2-2e67058fe04d
https://github.com/Expensify/App/assets/93399543/edbc23ea-d3fd-4372-8dd7-d9770b94866c
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1685522100748299
View all open jobs on GitHub
Upwork Automation - Do Not Edit