From 25b3794e90cb93b6f9c0dd13f785b7200cc31f39 Mon Sep 17 00:00:00 2001 From: Omar Al-Ithawi Date: Mon, 19 Feb 2024 19:44:18 +0300 Subject: [PATCH] chore: pull_translations: use less Makefile commands and move it to Python `mkdir` should be in Python --- Makefile | 3 +-- openedx/core/djangoapps/plugins/i18n_api.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index cd6ba204a239..2db357b090b1 100644 --- a/Makefile +++ b/Makefile @@ -65,10 +65,9 @@ pull_plugin_translations: ## Pull translations from Transifex for edx_django_ut 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 - mkdir -p conf/plugins-locale/xblock.v1/ lms/static/js/xblock.v1-i18n cms/static/js python manage.py lms pull_xblock_translations --verbose $(ATLAS_OPTIONS) python manage.py lms compile_xblock_translations - cp -r lms/static/js/xblock.v1-i18n cms/static/js + python manage.py cms compile_xblock_translations pull_translations: ## pull translations from Transifex git clean -fdX conf/locale diff --git a/openedx/core/djangoapps/plugins/i18n_api.py b/openedx/core/djangoapps/plugins/i18n_api.py index 06bb715b22a5..ae8bb5628628 100644 --- a/openedx/core/djangoapps/plugins/i18n_api.py +++ b/openedx/core/djangoapps/plugins/i18n_api.py @@ -92,6 +92,7 @@ def ensure_empty_directory(self, directory): Ensure the pull directory is empty before running atlas pull. """ plugin_translations_root = directory + os.makedirs(plugin_translations_root, exist_ok=True) if os.listdir(plugin_translations_root): raise CommandError(f'"{plugin_translations_root}" should be empty before running atlas pull.')