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 2024-08-26][$250] Workspace – System message for changed workspace name is not translated to Spanish #46219

Closed
6 tasks done
lanitochka17 opened this issue Jul 25, 2024 · 36 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

@lanitochka17
Copy link

lanitochka17 commented Jul 25, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.12-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): gocemate+a706@gmail.com
Issue reported by: Applause - Internal Team

Issue found when executing PR #45970

Action Performed:

  1. On an account with multiple policies in NewDOt, create an expense on one.
  2. Log into OldDot and change the policy name
  3. Back in NewDot verify that there's a message in #Admin that says "updated the workspace name from X to Y"
  4. Go to Preferences> Change the language to Spanish
  5. From OldDot Cchange the workspace name again
  6. Go to admin room and check language on system message

Expected Result:

The system message should be translated to Spanish

Actual Result:

System message for changed workspace is not translated to Spanish. It appear on English even language is changed

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6552652_1721912097851.Recording__3576.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cff222f969263a52
  • Upwork Job ID: 1818044405838732218
  • Last Price Increase: 2024-07-29
  • Automatic offers:
    • suneox | Reviewer | 103338869
    • FitseTLT | Contributor | 103338870
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 25, 2024
Copy link

melvin-bot bot commented Jul 25, 2024

Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@FitseTLT
Copy link
Contributor

Proposal

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

Workspace – System message for changed workspace name is not translated to Spanish

What is the root cause of that problem?

We are not displaying the action POLICYCHANGELOG_UPDATE_NAME translating the message but instead display the action with ReportActionItemMessage which only displays the message fragments without translation

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

We need to include a translation first for policy changed text that takes new and old policy name as params then we will display the action here by creating an else if for POLICYCHANGELOG_UPDATE_NAME type action and pass the translated text as the message of ReportActionItemBasicMessage

} else {
const hasBeenFlagged =

We can of course create a util that returns the translated text. And also we can apply the same for other type of actions too that do not support translation yet.

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Jul 29, 2024
@johncschuster johncschuster added the External Added to denote the issue can be worked on by a contributor label Jul 29, 2024
@melvin-bot melvin-bot bot changed the title Workspace – System message for changed workspace name is not translated to Spanish [$250] Workspace – System message for changed workspace name is not translated to Spanish Jul 29, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 29, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Jul 29, 2024
@cretadn22
Copy link
Contributor

Proposal

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

System message for changed workspace name is not translated to Spanish

What is the root cause of that problem?

For update log messages in admin room, we don't translate to Spanish

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

function getReportActionMessageFragments(action: ReportAction): Message[] {
if (isOldDotReportAction(action)) {
const oldDotMessage = getMessageOfOldDotReportAction(action);
const html = isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.SELECTED_FOR_RANDOM_AUDIT) ? Parser.replace(oldDotMessage) : oldDotMessage;
return [{text: oldDotMessage, html: `<muted-text>${html}</muted-text>`, type: 'COMMENT'}];
}
if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.UPDATE_ROOM_DESCRIPTION)) {
const message = `${Localize.translateLocal('roomChangeLog.updateRoomDescription')} ${getOriginalMessage(action)?.description}`;
return [{text: message, html: `<muted-text>${message}</muted-text>`, type: 'COMMENT'}];
}
const actionMessage = action.previousMessage ?? action.message;
if (Array.isArray(actionMessage)) {
return actionMessage.filter((item): item is Message => !!item);
}
return actionMessage ? [actionMessage] : [];
}

We’ve added a function to translate system messages, but we haven't included the POLICYCHANGELOG_UPDATE_NAME action. We need to incorporate logic to handle the translation for the POLICYCHANGELOG_UPDATE_NAME action.

if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_NAME)) {
        const oldName = getOriginalMessage(action)?.oldName ?? '';
        const newName = getOriginalMessage(action)?.newName ?? '';
        const message = `${Localize.translateLocal('workspace.renamedPolicyAction.renamedPolicyAction', {oldName, newName})}`;   // NEED TO CREATE A NEW TRANSLATION KEY renamedPolicyAction
        return [{text: message, html: `<muted-text>${message}</muted-text>`, type: 'COMMENT'}];
    }

For example, en.ts (need to confirm Spanish translation in es.ts)

renamedPolicyAction: {
    renamedPolicyAction: ({oldName, newName}: RenamedRoomActionParams) => ` updated the name of this workspace from ${oldName} to ${newName}`,
},

I've observed that other update log messages, such as POLICYCHANGELOG_UPDATE_FIELD, also aren't translated into Spanish. We should apply the same approach to address these cases as well.

What alternative solutions did you explore? (Optional)

@suneox
Copy link
Contributor

suneox commented Jul 30, 2024

@FitseTLT @cretadn22 Thank you for your proposals.

The RCA from both solutions is correct, and both solutions include updating the new translation. In spite of the proposal from @cretadn22 being more detailed but since the policy name does not support markdown so there is no need to update the render as a fragment with TextCommentFragment.

The solution from @FitseTLT was provided first, and rendering the content as ReportActionItemBasicMessage also makes sense in this case.

So @FitseTLT proposal is LGTM, and we should also update alternateText for the sidebar.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Jul 30, 2024

Triggered auto assignment to @robertjchen, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@robertjchen
Copy link
Contributor

Thanks for the proposals and review. Let's go with @FitseTLT 's 👍

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 31, 2024
Copy link

melvin-bot bot commented Jul 31, 2024

📣 @suneox 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Jul 31, 2024

📣 @FitseTLT 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 📖

@FitseTLT
Copy link
Contributor

FitseTLT commented Aug 1, 2024

@johncschuster I need a copy for
updated the name of this workspace from ${oldName} to ${newName}
Thx

@FitseTLT
Copy link
Contributor

FitseTLT commented Aug 2, 2024

@johncschuster or @robertjchen Can you add the Need a Copy label? Thx

@melvin-bot melvin-bot bot added the Overdue label Aug 2, 2024
@johncschuster johncschuster added Waiting for copy User facing verbiage needs polishing and removed Daily KSv2 Overdue Bug Something is broken. Auto assigns a BugZero manager. labels Aug 2, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Aug 11, 2024
@robertjchen
Copy link
Contributor

Just some conflicts to be resolved on the PR and I can merge 👍

@robertjchen
Copy link
Contributor

Merged and on the way out!

@robertjchen robertjchen removed Waiting for copy User facing verbiage needs polishing Reviewing Has a PR in review labels Aug 23, 2024
@robertjchen
Copy link
Contributor

On prod

@robertjchen robertjchen added the Bug Something is broken. Auto assigns a BugZero manager. label Aug 27, 2024
Copy link

melvin-bot bot commented Aug 27, 2024

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

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Aug 27, 2024
@robertjchen
Copy link
Contributor

@johncschuster could you please help with the next steps here? Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Aug 27, 2024
@suneox
Copy link
Contributor

suneox commented Aug 30, 2024

@johncschuster This issue has been deployed to production over a week, so I think we should add label await payment

@robertjchen robertjchen added the Awaiting Payment Auto-added when associated PR is deployed to production label Aug 30, 2024
@melvin-bot melvin-bot bot added the Overdue label Sep 2, 2024
Copy link

melvin-bot bot commented Sep 2, 2024

@danielrvidal, @robertjchen, @johncschuster, @suneox, @FitseTLT Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@suneox
Copy link
Contributor

suneox commented Sep 3, 2024

This issue has been deployed to production 2 weeks ago. We're waiting for payment

@melvin-bot melvin-bot bot removed the Overdue label Sep 3, 2024
@johncschuster
Copy link
Contributor

Sorry about that! I process my "Hold for payment" issues every morning (by way of filtering specifically for those issue titles), and I missed this since the automation didn't seem to change the title. I'll get this sorted!

@johncschuster
Copy link
Contributor

Payment Summary:

Contributor: @FitseTLT paid $250 via Upwork
Contributor+: @suneox owed $250 via Upwork

@johncschuster johncschuster changed the title [$250] Workspace – System message for changed workspace name is not translated to Spanish [HOLD for payment 2024-08-26][$250] Workspace – System message for changed workspace name is not translated to Spanish Sep 3, 2024
@johncschuster
Copy link
Contributor

(I've updated the title to make sure I see this when I action my payment issues in the morning)

@suneox
Copy link
Contributor

suneox commented Sep 4, 2024

@johncschuster I've accepted the offer

@FitseTLT
Copy link
Contributor

FitseTLT commented Sep 4, 2024

@johncschuster There is already an offer that I have already accepted.

@johncschuster
Copy link
Contributor

Thanks for clarifying that, @FitseTLT! I'll use the offer you've already accepted and will close the new one I made.

@johncschuster
Copy link
Contributor

I've issued payment! Thank you both for your contributions! 🎉

@robertjchen
Copy link
Contributor

thanks!

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
No open projects
Status: Done
Development

No branches or pull requests

7 participants