-
Notifications
You must be signed in to change notification settings - Fork 4k
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: fix missing gettext
functions if translations aren't pulled in development environments
#34416
Conversation
Thanks for the pull request, @OmarIthawi! 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 as you can:
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. |
a8e5501
to
b208e97
Compare
gettext
functions if translations aren't pulled in devstackgettext
functions if translations aren't pulled in development environments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick PR @OmarIthawi .
If someone is in development mode and they have pulled translations, will they still be able to see translated pages, or would this PR prevent that? For example, if a developer wants to be sure that their page renders OK using an RTL language, I want to make sure that they can still do that.
Based on my understanding of I'd think this PR wouldn't prevent that. It'd probably be best for @OmarIthawi to confirm though |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, duh :)
% if LANGUAGE_CODE != 'en':
<script type="text/javascript" src="${static.url(jsi18n_path)}"></script>
@OmarIthawi @brian-smith-tcril I've been trying to test this locally, but I haven't been able to successfully get my |
@kdmccormick That's a bug. I'll test again locally and move set this pull request as "Ready to merge" again. |
ece2f67
to
746702e
Compare
@kylecrawshaw the code now works only for development because I've tested it and it works okay on devstack with the Arabic language enabled via DarkLang in Django admin. Please let me know if you spot any issue in Tutor. This fix should be production-safe and fixes the fresh-Tutor build issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks @OmarIthawi !
I'll merge this shortly.
@OmarIthawi 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
2U Release Notice: This PR has been deployed to the edX production environment. |
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
2U Release Notice: This PR has been deployed to the edX production environment. |
1 similar comment
2U Release Notice: This PR has been deployed to the edX production environment. |
Problem
After #34355 LMS and CMS broke due to missing
djangojs.js
file for English and other languages. The current workaround is to runmake pull_translations
which is rather inconvenient for development and might not be ran in production builds.Solution
This is a proposed fix to address the issue in Tutor builds (overhangio/tutor#1024). It works only in development mode and if English is used because
atlas pull
provides not English translations.TODO
Details
Refs
This pull request is part of the FC-0012 project which implements the Translation Infrastructure update OEP-58.