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

Session timeout message still displaying in Spanish for English locale #694

Closed
JohnGillanders opened this issue May 21, 2023 · 4 comments
Closed

Comments

@JohnGillanders
Copy link

For a user with English language selected, the message that appears about the session timing out still displays as Spanish (on last test, a few weeks ago):
"Tu sesión ha caducado. Por favor, regístrate nuevamente para continuar."
Please translate to English.

@markets
Copy link
Collaborator

markets commented Nov 23, 2023

Fixed by #712, it will be live in next release!

@markets markets closed this as completed Nov 23, 2023
@JohnGillanders
Copy link
Author

JohnGillanders commented Nov 23, 2023 via email

@nflorentin
Copy link
Contributor

nflorentin commented Jan 15, 2024

I think that we could reopen this issue.

I'm still having the problem in production.

The problem is that I could not reproduce it on my local. I change Devise.timeout_in to few seconds. I sign in, I wait a few seconds, refresh my page, and I'm seeing the message in my selected language.

On production, I'm always having the message in spanish, and sometimes even in English, even though I've always the french language selected and I'm seeing the interface in French. That means that the problem is only present in Devise module.

@nflorentin
Copy link
Contributor

nflorentin commented Jan 15, 2024

I understood the problem.

Devise uses Warden under the hood, and Warden uses a middleware to check if session is valid, our controller defining the "set_locale" before_action is never reached, because Warden middleware cuts the request flow before it happens.

It seems to be a small fix but it is not so small, one solution would be to write a middleware to set the locale and insert this middleware before warden middleware in order to have I18n.locale set before warden middlware executes.

I think the next release of devise (4.9.4) will fix that problem, see heartcombo/devise#5567

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

No branches or pull requests

3 participants