[OSPR-5796] [BB-2862] "LANGUAGE_CODE" site configuration option - #27696
Conversation
|
Thanks for the pull request, @0x29a! I've created OSPR-5796 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
|
@0x29a Thank you for your contribution. Please let me know once it is ready for our review. |
aeaab6c to
879ab3c
Compare
|
📣 💥 Heads-up: You must either rebase onto master or merge master into your branch to avoid breaking the build. We recently removed diff-quality and introduced lint-amnesty. This means that the automated quality check that has run on your branch doesn't work the same way it will on master. If you have introduced any quality failures, they might pass on the PR but then break the build on master. This branch has been detected to not have commit 2e33565 as an ancestor. Here's how to see for yourself: If you have any questions, please reach out to the Architecture team (either #edx-shared-architecture on Open edX Slack or #architecture on edX internal). |
viadanna
left a comment
There was a problem hiding this comment.
Good to go 👍
- I tested this on the sandbox.
- I read through the code.
879ab3c to
aa8e5bf
Compare
|
@natabene, this is ready for edX review. |
|
@0x29a Hello. I can't test it through the steps mentioned in the PR. The default language when accessing the sandbox is Arabic. I tried changing to English/Spanish and then creating a new session in the anonymous tab but I am still seeing Arabic text over the platform. Can you update the steps/add any missing context? Thank you |
|
Hi @DawoudSheraz. Sorry for the delay here. I've managed to reproduce the issue you've encountered. The problem is that site configuration is cached by This behavior seems pretty confusing to me because site configuration helper method is already decorated in |
Hi @0x29a . Thanks for the detailed context. If you can change the configuration of the sandbox, it would be good and make it easier to review the changes. As for the double caching, I am afraid I am short on the context. |
|
@DawoudSheraz, I set |
|
The changes are good. I don't have access to see BB tickets, so can you add some more context in PR description/link to any issue to explain why the addition of setting via site configuration is needed? |
Cherry-picked from: https://github.com/edx/edx-platform/pull/27696
Cherry-picked from: https://github.com/edx/edx-platform/pull/27696
|
@DawoudSheraz, I expanded PR description a bit. Does it look better now? |
Yes, better. But one thing: adding the value in site configuration eventually changes the entire site(given the translations are present). The statement |
|
@DawoudSheraz, I rephrased the sentence you mentioned. |
|
@marcotuts, I see that this PR is missing some context about what we want to achieve by doing this. We have some instances which have multi-site configurations to provide courses in different languages. For this example, let's assume that we have an instance offering courses in English and French. When users go to a
This is still true.
Yes, we were considering this, but given that users can switch between these sites, we would need to add middleware, which:
This makes the approach much more complex and time-consuming, and thus degrades the user experience.
This is not a goal, but a consequence. If a site will have a
I've mentioned the language preview feature - this is something we could reuse for achieving this by updating user language preferences for the preview in the existing middleware, but this is going to break the language preview functionality for sites with I hope this clarifies it a bit. Please ping me if you have any questions. |
|
@marcotuts Hello. Is this good to merge or are there still reservations? Thank you |
Cherry-picked from: https://github.com/edx/edx-platform/pull/27696
* [SE-4101] fix: address VisibleBlocks caching race condition (openedx#27359) (#349) * fix: address VisibleBlocks caching race condition * sets visual block creation in an atomic transaction * refactor: add logging statement to bulk create Co-authored-by: Raul Gallegos <raul@opencraft.com> Co-authored-by: Raul Gallegos <raul@opencraft.com> * BB-3954 Add toggle for enrollment behavior (#351) Adds toggle REDIRECT_UNAUTHENTICATED_USER_TO_LOGIN_ON_ENROLL for enrollment behaviour for unauthenticated user. If true, the user will be redirected to 'signin_user' route. Co-authored-by: Arjun Singh Yadav <arjun@opencraft.com> * [BB-3622] feat:Restrict user create course (#319) (#352) * Add course creation condition for organization The condition added to ensure that if the feature is enabled user will not be able to create the course outside of the organization in which they belong. Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com> * fix: update the xblock-lti-consumer commit * Added new setting CERTIFICATE_DATE_FORMAT for easy customization of (#354) certificate issued date (cherry picked from commit 421e661) * fix: Produce grade report when subsections have future start dates When getting a subsection grade for a user, instead of failing if the user can't access that subsection, fallback to the collected structure. * Revert "Unhide student-generated certificates toggle" This reverts commit 8910ccf. Our clients are no longer using this feature, and edX won't accept this upstream as-is currently. See https://github.com/edx/edx-platform/pull/23735 for more information. Reverting to reduce code drift from upstream. * chore: update Arabic translations * fix:Fix function call to check MFE (#359) Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com> * fix: don't cache ajax request * feat: add site language config Cherry-picked from: https://github.com/edx/edx-platform/pull/27696 * Revert "[FAL-1813] fix: codejail issue when using matplotlib (#343)" (#365) This reverts commit 2143f84. * Update celery routing for celery 4+ (openedx#25567) * Update celery routing - Used routing function instead of class - Move task queues dictionary to Django settings - Removed routing_key parameter - Refactored routing for singleton celery instantiation Co-authored-by: Awais Qureshi <awais.qureshi@arbisoft.com> (cherry picked from commit e3b4d23) * fix: add missing set_code_owner_attribute imports (cherry picked from commit d1060d2) * chore: bump edx-django-utils to 3.12.0 The required `set_code_owner_attribute` decorator was introduced in v3.12.0, therefore we need to bump the dependency. (cherry picked from commit f52b84e) * [SE-4482] Allow delete course content in Studio only for admin users (#360) Co-authored-by: Nizar Mahmoud <nizarmah@hotmail.com> * fix: Password reset page throwing not found error (#364) Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com> * fix: change buttons in wiki modal to anchor tags The action buttons in wiki modal have href attribute but does not have an event listener for click. This PR changes the buttons to anchor tags so that they work as expected when clicked. * fix: use high priority queue for celery heartbeat check Makes HIGH_PRIORITY_QUEUE a derived setting, which allows HEARTBEAT_CELERY_ROUTING_KEY to use the correct config variant default. (cherry picked from commit 2a9067a) * fix: prevent invalidation of allowlisted certificates The allowlisted certificates were getting invalidated upon visiting the Course Progress page by users. This is a rough backport of the Lilac fix (edx#26356). In Lilac, this is gated by the `certificates_revamp.use_allowlist` Waffle flag. In post-Lilac branches, this is working out of the box (the flag has been removed in edx#27576). Jira ticket: BB-4287 * feat: add celery beat configuration Co-authored-by: Raul Gallegos <raul@opencraft.com> Co-authored-by: Farhaan Bukhsh <farhaan@opencraft.com> Co-authored-by: Arjun Singh Yadav <arjun@opencraft.com> Co-authored-by: pkulkark <pooja@opencraft.com> Co-authored-by: Shimul Chowdhury <shimul@opencraft.com> Co-authored-by: João Cabrita <joao.cabrita@opencraft.com> Co-authored-by: Samuel Walladge <samuel@opencraft.com> Co-authored-by: Giovanni Cimolin da Silva <giovannicimolin@gmail.com> Co-authored-by: 0x29a <demid@opencraft.com> Co-authored-by: Dmitry Gamanenko <dmitry.gamanenko@raccoongang.com> Co-authored-by: Jillian Vogel <jill@opencraft.com> Co-authored-by: Muhammad Soban Javed <58461728+iamsobanjaved@users.noreply.github.com> Co-authored-by: Sandeep Choudhary <sandeep@opencraft.com> Co-authored-by: Nizar Mahmoud <nizarmah@hotmail.com> Co-authored-by: Agrendalath <piotr@surowiec.it>
|
Checking with product now about this. |
|
The site configuration distinction and clarification above was helpful. No other concerns on me end |
|
@0x29a Hello. Can you rebase your PR, please? Once done, I will be merging this. Thank you |
aa8e5bf to
b01544d
Compare
|
Your PR has finished running tests. There were no failures. |
|
Hello, @DawoudSheraz. Done. |
|
@0x29a 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
|
@0x29a, @Agrendalath: @cmltaWt0 identified a couple of issues with this over on the Lilac backport ticket. Do you mind creating an (internal) ticket to investigate as a follow-up? |
|
Done, @arbrandes. |
…tion to Lilac # Description This PR contains changes from https://github.com/edx/edx-platform/pull/27696 PR cherry-picked to `open-release/lilac.master` branch.
Cherry-picked from: https://github.com/edx/edx-platform/pull/27696
Cherry-picked from: https://github.com/edx/edx-platform/pull/27696
One of our clients has an Arabic site and asked us if it's possible to show it in Arabic regardless of user's language settings. We discovered, that as is, it's impossible to do this in platform.
So, this PR is adding support of
LANGUAGE_CODEsite configuration option, which makes it possible to change translation of the entire site for all learners from Django admin panel.JIRA tickets:
Sandbox URL:
Testing instructions:
https://pr27696.sandbox.opencraft.hosting/ has default configuration.
staff:edx).LANGUAGE_CODEtoarand save.staff@example.com:edx).Reviewers