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

Fix wrong language (i.e. English) being picked instead of detected language in language selector #4624

Merged
merged 1 commit into from Sep 7, 2023

Conversation

noliveleger
Copy link
Contributor

@noliveleger noliveleger commented Sep 7, 2023

Description

Always save detected language to Django language cookie when it does not exist already to avoid falling back on English

Notes

Overload Django LocaleMiddleware to use the detected language by the middleware to set the cookie language when it is not present. It lets the front end load the correct value and set it when rendering the language dropdown menu.
Moreover, it will update extra_details.last_ui_language with correct value to get more accurate statistics.

Related issues

Fixes #2313

@noliveleger noliveleger changed the title Always save detected language to Django language cookie when it does not exist already Fix English being picked instead of detected language in language selector Sep 7, 2023
@noliveleger noliveleger changed the title Fix English being picked instead of detected language in language selector Fix wrong language (i.e. English) being picked instead of detected language in language selector Sep 7, 2023
@JacquelineMorrissette JacquelineMorrissette self-assigned this Sep 7, 2023
Copy link
Contributor

@JacquelineMorrissette JacquelineMorrissette left a comment

Choose a reason for hiding this comment

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

This is working on my end. 👍

@JacquelineMorrissette JacquelineMorrissette merged commit 58c8169 into beta Sep 7, 2023
4 checks passed
@JacquelineMorrissette JacquelineMorrissette deleted the 2313-set-cookie-when-not-present branch September 7, 2023 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants