Skip to content
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!: remove Transifex calls for FC-0012 - OEP-58 #34355

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ conf/locale/fake*/LC_MESSAGES/*.mo
# this was a mistake in i18n_tools, now fixed.
conf/locale/messages.mo
conf/plugins-locale/
conf/locale/*/LC_MESSAGES/
/*/static/js/i18n/
/*/static/js/xblock.v1-i18n/

### Testing artifacts
Expand Down
69 changes: 0 additions & 69 deletions .tx/config

This file was deleted.

36 changes: 5 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,60 +38,34 @@ technical-docs: ## build the technical docs
guides: swagger ## build the developer guide docs
cd docs/guides; make clean html

# (IS_OPENEDX_TRANSLATIONS_WORKFLOW) is set to "yes" in the `extract-translation-source-files` GitHub actions
# workflow on the `openedx-translations` repository. See (extract translation source files) step here:
# https://github.com/openedx/openedx-translations/blob/main/.github/workflows/extract-translation-source-files.yml
# Related doc: https://docs.openedx.org/en/latest/developers/how-tos/enable-translations-new-repo.html
ifeq ($(IS_OPENEDX_TRANSLATIONS_WORKFLOW),yes)
extract_translations: ## extract localizable strings from sources
i18n_tool extract --no-segment -v
cd conf/locale/en/LC_MESSAGES && msgcat djangojs.po underscore.po -o djangojs.po
cd conf/locale/en/LC_MESSAGES && msgcat django.po wiki.po edx_proctoring_proctortrack.po mako.po -o django.po
cd conf/locale/en/LC_MESSAGES && rm wiki.po edx_proctoring_proctortrack.po mako.po underscore.po
else
extract_translations: ## extract localizable strings from sources
i18n_tool extract -v;
endif

push_translations: ## push source strings to Transifex for translation
i18n_tool transifex push

pull_plugin_translations: ## Pull translations for edx_django_utils.plugins for both lms and cms
rm -rf conf/plugins-locale/plugins # Clean up existing atlas translations
mkdir -p conf/plugins-locale/plugins
python manage.py lms pull_plugin_translations --verbose $(ATLAS_OPTIONS)
python manage.py lms compile_plugin_translations

pull_xblock_translations: ## pull xblock translations via atlas
rm -rf conf/plugins-locale/xblock.v1 # Clean up existing atlas translations
rm -rf lms/static/i18n/xblock.v1 cms/static/i18n/xblock.v1 # Clean up existing xblock compiled translations
python manage.py lms pull_xblock_translations --verbose $(ATLAS_OPTIONS)
python manage.py lms compile_xblock_translations
python manage.py cms compile_xblock_translations

pull_translations: ## pull translations from Transifex
git clean -fdX conf/locale conf/plugins-locale/studio-frontend
ifeq ($(OPENEDX_ATLAS_PULL),)
i18n_tool transifex pull
i18n_tool extract
i18n_tool dummy
i18n_tool generate --verbose 1
git clean -fdX conf/locale/rtl
git clean -fdX conf/locale/eo
i18n_tool validate --verbose
else
pull_translations: ## pull translations via atlas
# Clean up the existing translations
git clean -fdX conf/locale conf/plugins-locale */static/js/i18n/ */static/js/xblock.v1-i18n/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is causing some problems -- it deletes any virtualenv that's maintained inside the repo (.venv-3.8/ in my case) as well as the Open_edX.egg-info/ created when installing base requirements. The former causes the command to fail entirely, and the latter produces the following error:

RuntimeError: Model class openedx.core.djangoapps.content_libraries.models.ContentLibrary doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
make[1]: *** [Makefile:52: pull_xblock_translations] Error 1

Can we use a different command? Or is this even needed at all. It seems to me that a git pull should remove the files just fine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that if one of the path arguments to git clean doesn't exist and contains a globbing character (e.g. */static/js/xblock.v1-i18n/) then the command also removes some things outside of the given paths.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timmc-edx sorry about that. I don't fully understand why git clean is behaving like this, so I've gone and refactored the command to be more explicit and safe:


make pull_xblock_translations
make pull_plugin_translations
find conf/locale -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \;
atlas pull $(ATLAS_OPTIONS) \
translations/edx-platform/conf/locale:conf/locale \
translations/studio-frontend/src/i18n/messages:conf/plugins-locale/studio-frontend
i18n_tool generate
endif
python manage.py lms compilemessages
python manage.py lms compilejsi18n
python manage.py cms compilejsi18n


detect_changed_source_translations: ## check if translation files are up-to-date
i18n_tool changed

Expand Down
130 changes: 0 additions & 130 deletions cms/static/js/i18n/am/djangojs.js

This file was deleted.

Loading
Loading