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

[$250] Chat - System message when changing submission frequency to monthly, not translated to Spanish #56842

Open
5 of 8 tasks
vincdargento opened this issue Feb 13, 2025 · 13 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@vincdargento
Copy link

vincdargento commented Feb 13, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Issue was found while executing QA for PR #56188

Version Number: 9.0.98-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
If this was caught during regression testing, add the test name, ID and link from TestRail: #56188
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 - Android 12 - Chrome / Windows 10 - Chrome
App Component: Other

Action Performed:

  1. Open the staging.new.expensify.com website.
  2. Tap on "Settings" and select "Workspaces"
  3. Open any workspace.
  4. Tap on "More Features" and enable "Workflows"
  5. Open "Workflows" and enable "Delay Submissions"
  6. Change submission frequency to "Monthly" and select any date of the month (important).
  7. Return to "Settings" and select "Preferences"
  8. Change the language to Spanish,
  9. Navigate to inbox.
  10. Open the #Admins room.
  11. Check the language in which the system message that reflects the submissions frequency change is displayed.

Expected Result:

When changing the submission frequency to monthly and change the date, and changing language to Spanish, system message on #Admins room, reflecting this action, should be displayed in Spanish.

Actual Result:

When changing submission frequency to monthly and change the date, system message on #Admins room reflecting this action, is not translated to Spanish, despite the user changing the language preference.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021890440395516707285
  • Upwork Job ID: 1890440395516707285
  • Last Price Increase: 2025-02-14
  • Automatic offers:
    • truph01 | Contributor | 106194572
@vincdargento vincdargento added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Feb 13, 2025
Copy link

melvin-bot bot commented Feb 13, 2025

Triggered auto assignment to @Christinadobrzyn (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.

Copy link
Contributor

⚠️ @M00rish Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

@dangrous
Copy link
Contributor

I can handle internal review on this when ready, but should be fine to be external

@truph01
Copy link
Contributor

truph01 commented Feb 14, 2025

Proposal

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

  • When changing submission frequency to monthly and change the date, system message on #Admins room reflecting this action, is not translated to Spanish, despite the user changing the language preference.

What is the root cause of that problem?

  • When getting the report action message to display:
    function getWorkspaceUpdateFieldMessage(action: ReportAction): string {

    we didn't consider the case the updatedField is autoReportingOffset. As a result, we display the message from getReportActionText, which is not translated to preferred language:

return getReportActionText(action);

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

  • We should add an additional if block to handle case updatedField && updatedField === CONST.POLICY.COLLECTION_KEYS.AUTOREPORTING_OFFSET in here:
    if (updatedField && updatedField === CONST.POLICY.COLLECTION_KEYS.AUTOREPORTING_OFFSET) {
        const getMonthToDisplay = (month: string | number) => {
            if (month === CONST.POLICY.AUTO_REPORTING_OFFSET.LAST_DAY_OF_MONTH) {
                return translateLocal('workflowsPage.frequencies.lastDayOfMonth');
            }
            if (month === CONST.POLICY.AUTO_REPORTING_OFFSET.LAST_BUSINESS_DAY_OF_MONTH) {
                return translateLocal('workflowsPage.frequencies.lastBusinessDayOfMonth');
            }
            if (typeof month === 'number') {
                return toLocaleOrdinal(preferredLocale, month, false);
            }
            return '';
        };
        return translateLocal('workspaceActions.updateMonthlyOffset', {
            newValue: getMonthToDisplay(newValue),
            oldValue: getMonthToDisplay(oldValue),
        });
    }
  • The translation in en.ts and es.ts file are:
        updateMonthlyOffset: ({oldValue, newValue}) => {
            if (!oldValue) {
                return `set the monthly report submission date to "${newValue}"`;
            }
            return `updated the monthly report submission date from "${oldValue}" to "${newValue}"`;
        },
        updateMonthlyOffset: ({oldValue, newValue}) => {
            if (!oldValue) {
                return `establecer la fecha de envío del informe mensual a "${newValue}"`;
            }
            return `actualizar la fecha de envío del informe mensual de "${oldValue}" a "${newValue}"`;
        },

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

  • We should simulate the report contain this type off message and the language is spain then verify the proper translated message is shown.

What alternative solutions did you explore? (Optional)

@Christinadobrzyn Christinadobrzyn added the External Added to denote the issue can be worked on by a contributor label Feb 14, 2025
@melvin-bot melvin-bot bot changed the title Chat - System message when changing submission frequency to monthly, not translated to Spanish [$250] Chat - System message when changing submission frequency to monthly, not translated to Spanish Feb 14, 2025
Copy link

melvin-bot bot commented Feb 14, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 14, 2025
Copy link

melvin-bot bot commented Feb 14, 2025

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

Copy link

melvin-bot bot commented Feb 18, 2025

@dangrous, @Christinadobrzyn, @rayane-d Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Feb 18, 2025
@Christinadobrzyn
Copy link
Contributor

Hi @rayane-d! Can you take a peek at the proposal to see if we can move forward with it? TY!

@melvin-bot melvin-bot bot removed the Overdue label Feb 18, 2025
@rayane-d
Copy link
Contributor

@truph01 proposal looks good to me

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Feb 19, 2025

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 19, 2025
Copy link

melvin-bot bot commented Feb 19, 2025

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

@aldo-expensify
Copy link
Contributor

aldo-expensify commented Feb 19, 2025

ooops, I see now that @dangrous is here as internal engineer :P, I'll un-assign. The solution made sense to me, so I assigned @truph01 ! 🏃

@aldo-expensify aldo-expensify removed their assignment Feb 19, 2025
@dangrous
Copy link
Contributor

that works! Yeah I think it assigned you coz I'm technically OOO - but I can take care of this.

Proposal looks great, we should double check the translations in Slack if they're not already in the file, but that won't be hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: LOW
Development

No branches or pull requests

6 participants