Closed shadinaif closed 1 year ago
Thanks for the pull request, @shadinaif! 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.
Patch coverage: 100.00%
and project coverage change: +0.02%
:tada:
Comparison is base (
27025f4
) 99.75% compared to head (afabc56
) 99.77%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This one is ready @OmarIthawi @brian-smith-tcril , also tested on another package to ensure it's validity
It works great, but leaves the following side-effects:
django.po
file is deleted.text.po
is now a file.Admittedly, this behavior isn't going to break anything so it's perhaps clunky but okay to have since XBlocks needs to explicitly use the new flags and those XBlocks should avoid adding the mv
rename command.
Thank you @OmarIthawi , thank you @brian-smith-tcril . It is ready now
Please review again @OmarIthawi . I've tested again on both xblock-drag-and-drop
and edx-platform
. I believe we nailed it now :)
@shadinaif 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.
feat: add two new options,
merge-po-files
andno-segment
After we passed a lot of steps in FC-0012 project; we see a need to add the following options to
extract
command because it'll serve us in a shared logic between many other packages (especially XBlocks). So, instead of repeating the same logic in Makefiles; we just add the options. DRY, and more readable--no-segment
: we have a logic inextract
command that generates (partial files). This is needed because of the complicity ofedx-platform
. But it creates a burden on small XBlocks that are always interested in the finaldjango.po
. Before this option; we have to always rename the generateddjango-partial.po
todjango.po
. The option will also skip the segment process is any--merge-po-files
: small packages (like small XBlocks) don't need to have two separate translation files for HTML and JS. We usually merge the generated filedjangojs.po
intodjango.po
manually. This option will take care of that without repeating the steps in all small packages[x] Related unit tests added
[x] All tests pass successfully
[x] Testing behavior in another package (see Local Manual Testing section)
Local Manual Testing
I used xblock-drag-and-drop-v2 locally to test
extract
command:Set this PR in requirement instead of the current
1.1.0
version. Done intest.in
fileedx-i18n-tools # For i18n_tool dummy
git+https://github.com/Zeit-Labs/i18n-tools.git@b739443cfcfe411c0dfedcc94b245585f1350264#egg=edx-i18n-tools==1.1.0
Run
make upgrade
Remove
django.po
file andtext.po
symbolic link fromxblock-drag-and-drop-v2/drag_and_drop_v2/conf/locale/en/LC_MESSAGES
Update
extract_translations
command inMakefile
cd $(WORKING_DIR) && i18n_tool extract
mv $(EXTRACTED_DJANGO_PARTIAL) $(EXTRACTED_DJANGO)
Safely concatenate djangojs if it exists. The file will exist in this repo, but we're trying to follow a pattern
between all repositories that use i18n_tool
if test -f $(EXTRACTED_DJANGOJS_PARTIAL); then \
msgcat $(EXTRACTED_DJANGO) $(EXTRACTED_DJANGOJS_PARTIAL) -o $(EXTRACTED_DJANGO) && \
rm $(EXTRACTED_DJANGOJS_PARTIAL); \
fi
cd $(WORKING_DIR) && i18n_tool extract --merge-po-files --no-segment
mv $(EXTRACT_DIR)/django.po $(EXTRACT_DIR)/text.po
Run
make extract_translations
.text.po
is generated successfullyCommit changes (because there are tests that validate translation to ensure all new are committed)
Run
py38-django32
andtranslations-django32
tests of xblock-drag-and-drop-v2 package. All passed