Skip to content
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-06-23] [$1000] Room - Room name rename text is translated in chat but not translated to Spanish in LHN #20124

Closed
3 of 6 tasks
kbecciv opened this issue Jun 3, 2023 · 34 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Jun 3, 2023

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:

  1. Open the app
  2. Open any room or create new room
  3. Click on room name in header, change room name using: settings->room name
  4. Change language to Spanish and observe that room name text in chat is translated to Spanish but LHN text is not translated

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?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

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

room.rename.lhn.no.translate.mp4
Recording.2961.mp4

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
  • Upwork Job URL: https://www.upwork.com/jobs/~01b9817b9e53ecc2b4
  • Upwork Job ID: 1665754369245933568
  • Last Price Increase: 2023-06-05
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 3, 2023

Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Jun 3, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@c3024
Copy link
Contributor

c3024 commented Jun 3, 2023

Proposal

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.

What is the root cause of the problem?

https://github.com/Expensify/App/blob/0813e2ca1476635a8324cbd9f998424663a33128/src/components/LHNOptionsList/OptionRowLHN.js#LL202C44-L202C44

Here alternativeText is not translated.

What changes do you think we should make in order to solve the problem?

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.

What other solutions did you explore?

None

@Ollyws
Copy link
Contributor

Ollyws commented Jun 3, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

When the language is changed to Spanish, the text in the LHN is still in English.

What is the root cause of that problem?

We are using the last message in the LHN which comes from the backend and just says "Room renamed to..."

What changes do you think we should make in order to solve the problem?

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})
        }
    }

What alternative solutions did you explore? (Optional)

None

@melvin-bot melvin-bot bot added the Overdue label Jun 5, 2023
@johncschuster johncschuster added the External Added to denote the issue can be worked on by a contributor label Jun 5, 2023
@melvin-bot melvin-bot bot changed the title Room - Room name rename text is translated in chat but not translated to Spanish in LHN [$1000] Room - Room name rename text is translated in chat but not translated to Spanish in LHN Jun 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 5, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01b9817b9e53ecc2b4

@melvin-bot
Copy link

melvin-bot bot commented Jun 5, 2023

Current assignee @johncschuster is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jun 5, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (External)

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 5, 2023

Triggered auto assignment to @neil-marcellini (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@abdulrahuman5196
Copy link
Contributor

Not overdue melvin now only came external

@melvin-bot melvin-bot bot removed the Overdue label Jun 5, 2023
@aidear3
Copy link

aidear3 commented Jun 5, 2023

Contributor details
Your Expensify account email: javsfdev323@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01b7fc496875b2b3dd

@melvin-bot
Copy link

melvin-bot bot commented Jun 5, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@kamaljitSharma21
Copy link
Contributor

kamaljitSharma21 commented Jun 6, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Room - Room name rename text is translated in chat but not translated to Spanish in LHN has context menu

What is the root cause of that problem?

The alternateText is coming directly from backend and we are displaying it as it is without translating.

What changes do you think we should make in order to solve the problem?

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 :

proposal.mov

What alternative solutions did you explore? (Optional)

NA

@abdulrahuman5196
Copy link
Contributor

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 chat renamed this room from ${oldName} to ${newName} since LHN is a small space.

🎀👀🎀
C+ Reviewed

cc: @neil-marcellini

@kamaljitSharma21
Copy link
Contributor

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 chat renamed 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?

@abdulrahuman5196
Copy link
Contributor

@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.

@neil-marcellini
Copy link
Contributor

I agree with @abdulrahuman5196's decision that @Ollyws' proposal #20124 (comment) looks best. I think it might need some small tweaks but we'll handle that in the PR.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 8, 2023

📣 @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 📖

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Jun 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 14, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @Ollyws got assigned: 2023-06-08 19:08:11 Z
  • when the PR got merged: 2023-06-14 18:38:34 UTC
  • days elapsed: 4

On to the next one 🚀

@Ollyws
Copy link
Contributor

Ollyws commented Jun 14, 2023

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.

@neil-marcellini
Copy link
Contributor

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 😄

@johncschuster
Copy link
Contributor

Thanks, @neil-marcellini! I'll make sure the bonus is included 👍

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jun 16, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Room - Room name rename text is translated in chat but not translated to Spanish in LHN [HOLD for payment 2023-06-23] [$1000] Room - Room name rename text is translated in chat but not translated to Spanish in LHN Jun 16, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.28-5 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-06-23. 🎊

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:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

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:

  • [@abdulrahuman5196] The PR that introduced the bug has been identified. Link to the PR:
  • [@abdulrahuman5196] 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:
  • [@abdulrahuman5196] 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:
  • [@abdulrahuman5196] Determine if we should create a regression test for this bug.
  • [@abdulrahuman5196] 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.
  • [@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@abdulrahuman5196
Copy link
Contributor

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.

@neil-marcellini
Copy link
Contributor

Not overdue, gentle bump @johncschuster

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2023
@johncschuster
Copy link
Contributor

@dhanashree-sawant / @Ollyws / @abdulrahuman5196 can you please apply to the Upwork job, here? I'll get payment issued shortly!

@abdulrahuman5196
Copy link
Contributor

Thank you. Applied for the upwork job @johncschuster

@Ollyws
Copy link
Contributor

Ollyws commented Jun 26, 2023

@johncschuster Also applied. Thanks!

@johncschuster
Copy link
Contributor

Great! I've extended offers to you both!

@Ollyws
Copy link
Contributor

Ollyws commented Jun 26, 2023

@johncschuster Accepted, thanks!

@johncschuster
Copy link
Contributor

johncschuster commented Jun 26, 2023

Payment has been issued to @Ollyws and @abdulrahuman5196 🎉

I still need to pay @dhanashree-sawant before closing the issue.

@dhanashree-sawant
Copy link

Hi @johncschuster,
Thank you. Applied for the upwork job

@johncschuster
Copy link
Contributor

All payments have been issued! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants