Skip to content

Commit

Permalink
feat: use atlas in make pull_translations
Browse files Browse the repository at this point in the history
This contribution is part of the [FC-0012 project](https://openedx.atlassian.net/l/cp/XGS0iCcQ) which is sparked by the [Translation Infrastructure update OEP-58](https://open-edx-proposals.readthedocs.io/en/latest/architectural-decisions/oep-0058-arch-translations-management.html#specification).
  • Loading branch information
OmarIthawi committed Aug 18, 2023
1 parent 8d83b4a commit 70b9ee0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ENV DEBIAN_FRONTEND noninteractive
RUN apt update && \
apt-get install -qy \
curl \
gettext \
# required by bower installer
git \
language-pack-en \
Expand Down
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ migrate: ## Apply database migrations
html_coverage: ## Generate and view HTML coverage report
coverage html && open htmlcov/index.html

compile_translations: ## Compile .po files to .mo files
cd course_discovery && PYTHONPATH="..:${PYTHONPATH}" django-admin.py compilemessages

# This Make target should not be removed since it is relied on by a Jenkins job (`edx-internal/tools-edx-jenkins/translation-jobs.yml`), using `ecommerce-scripts/transifex`.
extract_translations: ## Extract strings to be translated, outputting .po and .mo files
# NOTE: We need PYTHONPATH defined to avoid ImportError(s) on CI.
Expand All @@ -104,8 +107,16 @@ extract_translations: ## Extract strings to be translated, outputting .po and .m
cd course_discovery && PYTHONPATH="..:${PYTHONPATH}" django-admin.py compilemessages

# This Make target should not be removed since it is relied on by a Jenkins job (`edx-internal/tools-edx-jenkins/translation-jobs.yml`), using `ecommerce-scripts/transifex`.
ifeq ($(OPENEDX_ATLAS_PULL),)
pull_translations: ## Pull translations from Transifex
tx pull -a -f -t --mode reviewed --minimum-perc=1
else
# Experimental: OEP-58 Pulls translations using atlas
pull_translations:
find course_discovery/conf/locale -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \;
atlas pull $(OPENEDX_ATLAS_ARGS) translations/course-discovery/course_discovery/conf/locale:course_discovery/conf/locale
python manage.py compilemessages
endif

# This Make target should not be removed since it is relied on by a Jenkins job (`edx-internal/tools-edx-jenkins/translation-jobs.yml`), using `ecommerce-scripts/transifex`.
push_translations: ## Push source translation files (.po) to Transifex
Expand Down
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ html2text
lxml
jsonfield
markdown
openedx-atlas
pillow
pycountry
python-dateutil
Expand Down
2 changes: 2 additions & 0 deletions requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,8 @@ oauthlib==3.2.2
# social-auth-core
openai==0.27.8
# via taxonomy-connector
openedx-atlas==0.4.4
# via -r requirements/base.in
openedx-events==8.5.0
# via
# edx-event-bus-kafka
Expand Down
2 changes: 2 additions & 0 deletions requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ oauthlib==3.2.2
# social-auth-core
openai==0.27.8
# via taxonomy-connector
openedx-atlas==0.4.4
# via -r requirements/base.in
openedx-events==8.5.0
# via
# edx-event-bus-kafka
Expand Down

0 comments on commit 70b9ee0

Please sign in to comment.