Skip to content

Commit

Permalink
feat: use atlas in make pull_translations (openedx#4037)
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 837d3eb commit 7fe4128
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ FROM ubuntu:focal as app
ENV DEBIAN_FRONTEND noninteractive
# System requirements.
RUN apt update && \
apt-get install -qy \
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 @@ -104,8 +104,19 @@ 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

@echo "Translations pulled from Transifex and compiled."
@echo "'make static' or 'make static.dev' is required to update the js i18n files."
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 @@ -558,6 +558,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 7fe4128

Please sign in to comment.