diff --git a/Dockerfile b/Dockerfile index 5eeb76fe686..8a06c2ad9b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ git \ language-pack-en \ build-essential \ diff --git a/Makefile b/Makefile index f12310e0016..ac03fab4661 100644 --- a/Makefile +++ b/Makefile @@ -126,7 +126,13 @@ compile_translations: requirements.tox fake_translations: extract_translations dummy_translations compile_translations pull_translations: +ifeq ($(OPENEDX_ATLAS_PULL),) cd ecommerce && tx pull -a -f -t --mode reviewed +else + find ecommerce/conf/locale -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \; + atlas pull $(OPENEDX_ATLAS_ARGS) translations/ecommerce/ecommerce/conf/locale:ecommerce/conf/locale + python manage.py compilemessages +endif push_translations: cd ecommerce && tx push -s diff --git a/ecommerce/conf/locale/config.yaml b/ecommerce/conf/locale/config.yaml index 7467d5281e7..c65c70a84d2 100644 --- a/ecommerce/conf/locale/config.yaml +++ b/ecommerce/conf/locale/config.yaml @@ -92,5 +92,6 @@ ignore_dirs: - i18n - assets - node_modules + - tests - static/bower_components - static/build diff --git a/requirements/base.in b/requirements/base.in index cbdd411b0dd..038495130d5 100755 --- a/requirements/base.in +++ b/requirements/base.in @@ -45,6 +45,7 @@ markdown==2.6.9 mysqlclient<1.5 newrelic ndg-httpsclient +openedx-atlas path.py==7.2 paypalrestsdk premailer==2.9.2 diff --git a/requirements/base.txt b/requirements/base.txt index e56f3335f90..af2d9bd119d 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -362,6 +362,8 @@ oauthlib==3.2.2 # getsmarter-api-clients # requests-oauthlib # social-auth-core +openedx-atlas==0.5.0 + # via -r requirements/base.in packaging==23.1 # via drf-yasg paramiko==3.2.0 diff --git a/requirements/dev.txt b/requirements/dev.txt index dc124d3b52a..2a0f69315d7 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -333,7 +333,7 @@ edx-drf-extensions==8.13.0 # edx-rbac edx-ecommerce-worker==3.3.4 # via -r requirements/test.txt -edx-i18n-tools==0.9.2 +edx-i18n-tools==1.3.0 # via -r requirements/test.txt edx-opaque-keys==2.3.0 # via @@ -570,6 +570,8 @@ oauthlib==3.2.2 # getsmarter-api-clients # requests-oauthlib # social-auth-core +openedx-atlas==0.5.0 + # via -r requirements/base.in packaging==23.1 # via # -r requirements/docs.txt diff --git a/requirements/production.txt b/requirements/production.txt index 95da1a4269e..a78cee4cdc3 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -372,6 +372,8 @@ oauthlib==3.2.2 # getsmarter-api-clients # requests-oauthlib # social-auth-core +openedx-atlas==0.5.0 + # via -r requirements/base.in packaging==23.1 # via drf-yasg paramiko==3.2.0 diff --git a/requirements/test.txt b/requirements/test.txt index 11feac73caa..36a56461be2 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -324,7 +324,7 @@ edx-drf-extensions==8.13.0 # edx-rbac edx-ecommerce-worker==3.3.4 # via -r requirements/base.txt -edx-i18n-tools==0.9.2 +edx-i18n-tools==1.3.0 # via -r requirements/test.in edx-opaque-keys==2.3.0 # via @@ -549,6 +549,8 @@ oauthlib==3.2.2 # getsmarter-api-clients # requests-oauthlib # social-auth-core +openedx-atlas==0.5.0 + # via -r requirements/base.in packaging==23.1 # via # -r requirements/base.txt diff --git a/tox.ini b/tox.ini index f2665c563c3..55d2b9e9847 100644 --- a/tox.ini +++ b/tox.ini @@ -41,6 +41,7 @@ setenv = tests: DJANGO_SETTINGS_MODULE = ecommerce.settings.test acceptance: DJANGO_SETTINGS_MODULE = ecommerce.settings.test check_keywords: DJANGO_SETTINGS_MODULE = ecommerce.settings.test + extract_translations: DJANGO_SETTINGS_MODULE= BOKCHOY_HEADLESS = true NODE_BIN = ./node_modules/.bin PATH=$PATH:$NODE_BIN @@ -51,7 +52,7 @@ deps = allowlist_externals = /bin/bash changedir = - dummy_translations,compile_translations,detect_changed_translations,validate_translations: ecommerce + extract_translations,dummy_translations,compile_translations,detect_changed_translations,validate_translations: ecommerce commands = static: python manage.py collectstatic --noinput --verbosity 0 static: python manage.py compress --force @@ -64,8 +65,7 @@ commands = pylint: pylint -j 0 --rcfile=pylintrc ecommerce e2e - extract_translations: python manage.py makemessages -l en -v1 -d django --ignore="docs/*" --ignore="src/*" --ignore="i18n/*" --ignore="assets/*" --ignore="node_modules/*" --ignore="ecommerce/static/bower_components/*" --ignore="ecommerce/static/build/*" - extract_translations: python manage.py makemessages -l en -v1 -d djangojs --ignore="docs/*" --ignore="src/*" --ignore="i18n/*" --ignore="assets/*" --ignore="node_modules/*" --ignore="ecommerce/static/bower_components/*" --ignore="ecommerce/static/build/*" + extract_translations: i18n_tool extract --no-segment dummy_translations: i18n_tool dummy compile_translations: python ../manage.py compilemessages