Skip to content

fix: fix side-wide language for legacy UI [BB-6388] - #483

Merged
Agrendalath merged 1 commit into
opencraft-release/maple.3from
agrendalath/bb-6388-cherry-pick_bb-4823
Jun 22, 2022
Merged

fix: fix side-wide language for legacy UI [BB-6388]#483
Agrendalath merged 1 commit into
opencraft-release/maple.3from
agrendalath/bb-6388-cherry-pick_bb-4823

Conversation

@Agrendalath

Copy link
Copy Markdown
Member

This cherry-picks openedx#29180 to our common Maple branch.

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)
@Agrendalath Agrendalath self-assigned this Jun 22, 2022
@Agrendalath

Copy link
Copy Markdown
Member Author

FYI, @farhaanbukhsh, because you will need this in #480.

@Agrendalath

Copy link
Copy Markdown
Member Author

Merging as a clean cherry-pick.

@Agrendalath
Agrendalath merged commit 8f6f797 into opencraft-release/maple.3 Jun 22, 2022
@Agrendalath
Agrendalath deleted the agrendalath/bb-6388-cherry-pick_bb-4823 branch June 22, 2022 17:11
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