-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: atlas pull
for XBlock translations | FC-0012
#33698
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. |
atlas pull
for XBlock translationsatlas pull
for XBlock translations | FC-0012
35ef496
to
238a29f
Compare
|
||
|
||
def get_javascript_i18n_file_path(xblock_module, locale): | ||
return settings.STATICI18N_ROOT / get_javascript_i18n_file(xblock_module, locale) |
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.
Here you're returning a path
type but above you're returning a string, is there a reason for that?
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.
Generally, Path
and str
are interchangeable and get_javascript_i18n_file_name
is used for URLs as well as file system paths. Therefore, it makes sense to use str
imo.
8f8b91c
to
00f2eb6
Compare
common/djangoapps/xblock_django/management/commands/pull_plugin_translations.py
Outdated
Show resolved
Hide resolved
common/djangoapps/xblock_django/management/commands/list_plugin_modules.py
Outdated
Show resolved
Hide resolved
@feanil @kdmccormick Thanks a lot for the code review yesterday! I've addressed most of the review comments already and added the rest as TODO check list items in the GitHub pull request description. Feel free to take a look now or later after tests are fixed. I'll fix tests and tag you for a review before I start adding new test cases. |
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.
Changes look good to me, I like the more general management command names also so it will be good to update the docs to match as you are already planning to do.
Thanks @feanil for the review. I'll finish the remainder TODOs, add tests and let you know when I'm done for a final review. |
4ad56c4
to
aa66857
Compare
8607782
to
a4c6e1e
Compare
@feanil this is ready again for review. I've added tests and refactored the work into reusable modules for future work (within FC-0012). |
Hey Omar, sounds good. FYI, I'm going on vacation for the next week so I probably won't get to this till the new year but I'll review it as soon as I can after I'm back. Looks like there are still some test failures to deal with. Let me know if you want me to wait for fixes or if I should start review as soon as I can. |
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.
Generally looks like it's ready to go, I had one question about an empty test file.
Makefile
Outdated
@@ -55,8 +56,19 @@ endif | |||
push_translations: ## push source strings to Transifex for translation | |||
i18n_tool transifex push | |||
|
|||
pull_translations: ## pull translations from Transifex | |||
pull_xblock_translations: |
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.
pull_xblock_translations: | |
pull_xblock_translations: ## pull xblock translations via atlas |
This comment becomes the help text for make help
so it's useful to have something.
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.
Is this file supposed to be empty?
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.
no, i forgot to add test for this one
e27e4a3
to
b18e222
Compare
@OmarIthawi it looks like this is good to go, is there anything else we need to do before we merge this? |
e18e3bf
to
5c7f47b
Compare
@feanil I think it's ready, I've pushed it with few more tests in |
@feanil @brian-smith-tcril A gentle reminder that this pull request is ready to be merged. |
5c7f47b
to
71e39c3
Compare
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.
Left a couple small docs suggestions but overall this LGTM!
@OmarIthawi if the suggestions look good to you, can you add them in? I can merge this PR tomorrow morning our time. |
Looks like this needs a rebase and conflict resolution as well now that the other atlas PR landed. |
7e5d409
to
769fb5f
Compare
769fb5f
to
90c6de9
Compare
90c6de9
to
a5251cc
Compare
find conf/locale -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \; | ||
atlas pull $(OPENEDX_ATLAS_ARGS) translations/edx-platform/conf/locale:conf/locale | ||
atlas pull $(ATLAS_OPTIONS) translations/edx-platform/conf/locale:conf/locale |
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 @feanil for the quick triage.
Conflicts has been resolved and I've tested it again and it seems to be playing well.
I've changed this line to match the Tutor option to have one less surprise for operators.
@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. |
1 similar comment
2U Release Notice: This PR has been deployed to the edX production environment. |
Implements the following proposal:
atlas pull
for the edx-platform and its plugins FC-0012 #33166Known limitations
edx-val
and any non-XBlock library. A follow up pull request will be created.translation.to_locale(lang_code)
vstranslation.to_locale(translation.get_language())
get_statici18n_js_url
plugin_translations
edX Platform module independent of XBlock module0019-oep-58-atlas-translations-design.rst
documentpull_xblock_translations
, otherwise remove the commandTesting instructions
Install the Drag and Drop v2 fork which supports OEP-58 translations:
Then add a Drag and Drop XBlock instance and it should use the translations from the
atlas pull
results instead of the bundled ones.Of course, it'll be difficult to distinguish which is which, therefore I've hacked the process as described in the
Testing results
.Testing results
I've manually replaced the
atlas pull
French translations with Chinese so I ensure that I'm not just seeing stale translations.This is a temp. hack during testing and it looks like the Drag and Drop v2 translation is being pulled correctly via atlas.
These are the lines that I've added after the
atlas pull
command:Screenshots
Python code translations
JavaScript code translations
Refs
This pull request is part of the FC-0012 project which implements the Translation Infrastructure update OEP-58.