Skip to content

[HOLD for payment 2024-08-26][$250] Workspace – System message for changed workspace name is not translated to Spanish #46219

Closed

Description

@lanitochka17

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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 25, 2024
  2. melvin-bot commented on Jul 25, 2024

    @melvin-bot

    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.

  3. FitseTLT commented on Jul 25, 2024

    @FitseTLT
    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)

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 29, 2024
  5. 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[/+] on Jul 29, 2024
  6. melvin-bot commented on Jul 29, 2024

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 29, 2024
  8. melvin-bot commented on Jul 29, 2024

    @melvin-bot

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

  9. cretadn22 commented on Jul 30, 2024

    @cretadn22
    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)

  10. 47 remaining items

  11. melvin-bot commented on Sep 2, 2024

    @melvin-bot

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

  12. suneox commented on Sep 3, 2024

    @suneox
    Contributor

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

  13. johncschuster commented on Sep 3, 2024

    @johncschuster
    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!

  14. johncschuster commented on Sep 3, 2024

    @johncschuster
    Contributor

    Payment Summary:

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

  15. 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[/+] on Sep 3, 2024
  16. johncschuster commented on Sep 3, 2024

    @johncschuster
    Contributor

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

  17. suneox commented on Sep 4, 2024

    @suneox
    Contributor

    @johncschuster I've accepted the offer

  18. FitseTLT commented on Sep 4, 2024

    @FitseTLT
    Contributor

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

  19. johncschuster commented on Sep 4, 2024

    @johncschuster
    Contributor

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

  20. johncschuster commented on Sep 4, 2024

    @johncschuster
    Contributor

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

  21. robertjchen commented on Sep 4, 2024

    @robertjchen
    Contributor

    thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions