-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add a setting flag to control user pref lang #5
Conversation
This add a setting variable that allow to show if the LANGUAGE_CODE of the site config would have more priority than the cookie of the user preference. The setting is `IGNORE_USER_LANGUAGE_COOKIE`, so by default the site config `LANGUAGE_CODE` woul have more prior but if the setting is set to False the user cookie would work.
here you are changing the migration commit logic and adding a new feature and I'd like to know why, is there another issue that you want to cover ? |
I had to change the migration commit logic due the code was moved, and the function _set_site_or_microsite_language was removed. Maybe the setting could be renamed to |
with logic a don't refer with the place where the code is writing I refer to what happens under some specific circumstances. Current maple logic: This PR Finally since we are using eox-tenant the settings behavior is different this code was designed with two different sources, first one is django settings, second one is site configuration, if |
I understood you. Instead of adding that setting flag logic: |
@andrey-canon looking for the tests like Or is better to update that test |
I think it's better to move out this is my suggestion:
should we restore the previous value ? |
This PR is closed in favor of continuing with the approach of an external plugin fix. |
Description
This is migration issue.
This add a setting variable that allow to show if the LANGUAGE_CODE of the site config would have more priority than the cookie of the user preference. The setting is
IGNORE_USER_LANGUAGE_COOKIE
, so by default the site configLANGUAGE_CODE
woul have more prior but if the setting is set to False the user cookie would work.migration context
The commit of the migration could not be applied due openedx change dark_lang middleware and set by default site_config language_code priority over the cookie. You can check that the function _set_site_or_microsite_language was removed.
Testing instructions
Use eox-tenant and set
LANGUAGE_CODE
. you can see there the cookie would be ignored.Before
Screencast.from.22-01-24.16.57.30.webm
After
Screencast.from.22-01-24.17.07.23.webm
Supporting information
PRS related.
eduNEXT/edunext-platform#672