fix: fix side-wide language for legacy UI [BB-6388] - #483
Merged
Agrendalath merged 1 commit intoJun 22, 2022
Merged
Conversation
When side-wide language is set via LANGUAGE_CODE site configuration, some elements of legacy UI still use the language set in user preferences (or None, which fallsback to 'en' if nothing is set in preferences). The expectation is that everything should be translated to the language which is set in the site configuration. In legacy UI (i.e. templates) the code of the current language sometimes is needed, and in these cases `user_language` variable from the context is used. The value for that variable is inserted via context processor, which takes the value from the user preferences. The solution modifies the context processor to check if there is a language set in site configuration, and if there is, send that value, instead of whatever value there was in user peferences. (cherry picked from commit ec1e3b6)
Member
Author
|
FYI, @farhaanbukhsh, because you will need this in #480. |
Member
Author
|
Merging as a clean cherry-pick. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This cherry-picks openedx#29180 to our common Maple branch.