Skip to content

Translate flashed messages (and add one) for authentication flow #28

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

Merged
merged 4 commits into from
Jun 5, 2024

Conversation

rudokemper
Copy link
Member

I have observed recently that some new users are unsure of what to do when they open the Superset /login page; it's not obvious to them that "Sign in with auth0" encompasses both signing up and logging in. I have therefore added a "welcome" message with helpful information about signing up or logging in to be flashed at the top of the page.

In the same stroke, I have added translations for all of the messages flashed by CustomAuth0AuthView. The translations include all of the currently supported (by us) languages in Superset - en, pt_BR, nl, es, fr.

image

@rudokemper rudokemper requested a review from IamJeffG June 5, 2024 19:46
# Extend the default AuthOAuthView to override the default message when the user is not authorized
class CustomAuthOAuthView(AuthOAuthView):
@expose("/login")
def login(self) -> WerkzeugResponse:
flash(translate("Welcome! Please sign up or log in with Auth0 below to access the application."), "info")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On an app I previously worked on, we realized people were confused about "sign in" vs "sign up" vs "log in" if our language didn't match exactly (by which, here, I mean "match the Auth0 button")

It was actually complicated by using a SSO provider (as we are now) which doesn't let you choose at this stage whether you will create an account vs login with an existing one; there's only one button and that confuses new users who think they don't have an account. Nothing we can do about that, but my main suggestion is to make sure the term in our flashed message matches the Auth0 button's term.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On an app I previously worked on, we realized people were confused about "sign in" vs "sign up" vs "log in" if our language didn't match exactly (by which, here, I mean "match the Auth0 button")

Yeah, this is exactly the issue I'm trying to solve with the flashed message.

my main suggestion is to make sure the term in our flashed message matches the Auth0 button's term.

The Auth0 button says "Sign in with auth0" (and it doesn't seem like it's translatable). I thought to supplement that with the message "Welcome! Please sign up or log in with Auth0 below to access the application" which I thought provided some clarification. But word smithing welcome.

Maybe "Welcome! Please sign up or log in by pressing 'Sign in with auth0' to access the application"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome! Please sign up or log in by pressing 'Sign in with auth0' to access the application"?

I like this one. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants