Skip to content

[HOLD for payment + bonus] Password error translation not updated on Language change #4663

Closed

Description

@mananjadhav

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. Go to Login page
  2. Don't enter anything and press enter
  3. You'll see an error Please enter an email or phone number
  4. Now change the language to Spanish
  5. You'll see the whole page is translated except for the error message.

Expected Result:

The error message should've been updated with the correct translation text

Actual Result:

Error message translation not updated on language change.
error-message-translation

Workaround:

The user will have to click the button again to get the correct error message.

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number:
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:

View all open jobs on Upwork

Activity

  1. MelvinBot commented on Aug 14, 2021

    @MelvinBot
    Contributor

    Triggered auto assignment to @greg-schroeder (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

  2. removed
    AutoAssignerTriageAuto assign issues for triage to an available triage team member
    on Aug 14, 2021
  3. mananjadhav commented on Aug 14, 2021

    @mananjadhav
    CollaboratorAuthor

    Proposal

    In the LoginForm.validateAndSubmitForm, we're storing the whole translated error message in the state.

    if (!this.state.login.trim()) {
        this.setState({formError: this.props.translate('loginForm.pleaseEnterEmailOrPhoneNumber')});
        return;
    }
    
    

    Instead we should only store the key and use translation in the render method

    //validateAndSubmitForm ()
    if (!this.state.login.trim()) {
        this.setState({formError: 'loginForm.pleaseEnterEmailOrPhoneNumber'});
        return;
    }
    
    
    // render()
    
    {this.state.formError && (
        <Text style={[styles.formError]}>
            {this.props.translate(this.state.formError)}
        </Text>
    )}
    
    
    
  4. mananjadhav commented on Aug 14, 2021

    @mananjadhav
    CollaboratorAuthor

    The same issue exists in PasswordForm too.

    image

    Also the error message is a little misleading when there's only one field it says, Please fill out all fields

  5. MelvinBot commented on Aug 16, 2021

    @MelvinBot
    Contributor

    Triggered auto assignment to @timszot (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

  6. removed their assignment
    on Aug 16, 2021
  7. 27 remaining items

  8. mananjadhav commented on Aug 24, 2021

    @mananjadhav
    CollaboratorAuthor

    @anthony-hull the error that I reported was more of UI issue even before hitting any API. If you notice the error has translation but it doesn't switch translation on language change.

    Your solution might be an extension/separate enhancement for API error handling. I am not sure if any issues exist with that. You can create an issue with relevant data/screenshots etc.

  9. anthony-hull commented on Aug 24, 2021

    @anthony-hull
    Contributor
  10. Jag96 commented on Aug 26, 2021

    @Jag96
    Contributor

    Sorry for the delay on this, @mananjadhav your proposal looks good, could you implement the change on the PasswordForm as well? Regarding the Please fill out all fields issue, I think #4856 will cover that one so for this issue let's just focus on the error translations. I've invited you to the Upwork job, once you accept feel free to start on the PR and I'll assign you.

    @anthony-hull I agree that the issue you pointed out is important, and I think we should handle it separately so we can standardize some way of doing that across the app. There is some discussion relating to that in this slack thread so I'd have a look there!

  11. mananjadhav commented on Aug 27, 2021

    @mananjadhav
    CollaboratorAuthor

    @Jag96 Sure. I’ll take care of both the issues. Thanks.

  12. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 27, 2021
  13. added and removed on Aug 27, 2021
  14. changed the title [-]Password error translation not updated on Language change[/-] [+][HOLD for payment + bonus] Password error translation not updated on Language change[/+] on Aug 27, 2021
  15. Jag96 commented on Sep 8, 2021

    @Jag96
    Contributor

    Fix has been on production for 7 days without regression, paid + bonus!

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions