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

[$62.50] Web - Chat - Error message not translated when changing language #52216

Open
1 of 8 tasks
lanitochka17 opened this issue Nov 7, 2024 · 12 comments
Open
1 of 8 tasks
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

@lanitochka17
Copy link

lanitochka17 commented Nov 7, 2024

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


Version Number: 9.0.59-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Log in to any account using two tabs
  2. In the first tab, open any chat that contains a protected PDF
  3. Click on the protected PDF, select "Enter password," and press Enter to trigger an error message
  4. In the second tab, change the language to Spanish
  5. Return to the first tab and observe the error message

Expected Result:

The error message should be translated to Spanish

Actual Result:

The error message remains in the original language and is not translated to Spanish

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence
Bug6657900_1731001767296.Recording__4488.mp4

19_

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021854646700760207529
  • Upwork Job ID: 1854646700760207529
  • Last Price Increase: 2024-11-07
  • Automatic offers:
    • Krishna2323 | Contributor | 104843295
Issue OwnerCurrent Issue Owner: @allroundexperts
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 7, 2024
Copy link

melvin-bot bot commented Nov 7, 2024

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

@Krishna2323
Copy link
Contributor

Krishna2323 commented Nov 7, 2024

Edited by proposal-police: This proposal was edited at 2024-11-07 20:21:16 UTC.

Proposal


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

Web - Chat - Error message not translated when changing language

What is the root cause of that problem?

  • We are saving the translated text in validationErrorText state and due to this the error message is not recalculated when the language changes.
    const errorText = useMemo(() => {
    if (isPasswordInvalid) {
    return translate('attachmentView.passwordIncorrect');
    }
    if (validationErrorText) {
    return validationErrorText;
    }
    return '';
    }, [isPasswordInvalid, validationErrorText, translate]);

    const validate = () => {
    if (!isPasswordInvalid && password) {
    return true;
    }
    if (!password) {
    setValidationErrorText(translate('attachmentView.passwordRequired'));
    }
    return false;

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


  • We should save the translation path in validationErrorText and return translate(validationErrorText); from errorText.
    const [validationErrorText, setValidationErrorText] = useState<TranslationPaths | null | ''>('');
    const errorText = useMemo(() => {
        if (isPasswordInvalid) {
            return translate('attachmentView.passwordIncorrect');
        }
        if (validationErrorText) {
            return translate(validationErrorText);
        }
        return '';
    }, [isPasswordInvalid, validationErrorText, translate]);
    
        const validate = () => {
        if (!isPasswordInvalid && password) {
            return true;
        }
        if (!password) {
            setValidationErrorText('attachmentView.passwordRequired');
        }
        return false;
    };
  • We should also look for similar bugs in other places.

What alternative solutions did you explore? (Optional)

Result

@joekaufmanexpensify joekaufmanexpensify added the External Added to denote the issue can be worked on by a contributor label Nov 7, 2024
Copy link

melvin-bot bot commented Nov 7, 2024

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

@melvin-bot melvin-bot bot changed the title Web - Chat - Error message not translated when changing language [$250] Web - Chat - Error message not translated when changing language Nov 7, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 7, 2024
Copy link

melvin-bot bot commented Nov 7, 2024

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

@joekaufmanexpensify
Copy link
Contributor

Very minor bug in somewhat niche flow, but we should fix it. Adjusting bounty downwards to reflect that this is a minor bug.

@joekaufmanexpensify joekaufmanexpensify changed the title [$250] Web - Chat - Error message not translated when changing language [$62.50] Web - Chat - Error message not translated when changing language Nov 7, 2024
@Jaeta01
Copy link

Jaeta01 commented Nov 11, 2024

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01df91cefb9efad4cb

@melvin-bot melvin-bot bot added the Overdue label Nov 11, 2024
Copy link

melvin-bot bot commented Nov 11, 2024

⚠️ Missing/invalid email or upwork profile link. Please make sure you add both your Expensify email and Upwork profile link in the format specified.

@allroundexperts
Copy link
Contributor

@Krishna2323's proposal looks good to me. Let's go with them.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Nov 11, 2024

Triggered auto assignment to @techievivek, 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 Nov 11, 2024
Copy link

melvin-bot bot commented Nov 11, 2024

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

@joekaufmanexpensify
Copy link
Contributor

@Krishna2323 Is there an ETA for the PR here?

@Krishna2323
Copy link
Contributor

@allroundexperts, PR ready for review ^

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: Bugs and Follow Up Issues
Development

No branches or pull requests

6 participants