diff --git a/cookiecutter-django-ida/{{cookiecutter.repo_name}}/Makefile b/cookiecutter-django-ida/{{cookiecutter.repo_name}}/Makefile index 0b90d224..c7edc4b9 100644 --- a/cookiecutter-django-ida/{{cookiecutter.repo_name}}/Makefile +++ b/cookiecutter-django-ida/{{cookiecutter.repo_name}}/Makefile @@ -77,7 +77,7 @@ lint: ## run Python code linting pylint --rcfile=pylintrc {{cookiecutter.project_name}} *.py quality: - tox -e quality + tox -e quality pii_check: ## check for PII annotations on all Django models DJANGO_SETTINGS_MODULE={{cookiecutter.project_name}}.settings.test \ @@ -119,8 +119,7 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy mv requirements/test.tmp requirements/test.txt extract_translations: ## extract strings to be translated, outputting .mo files - python manage.py makemessages -l en -v1 -d django - python manage.py makemessages -l en -v1 -d djangojs + cd {{cookiecutter.project_name}} && i18n_tool extract --no-segment dummy_translations: ## generate dummy translation (.po) files cd {{cookiecutter.project_name}} && i18n_tool dummy @@ -130,8 +129,18 @@ compile_translations: # compile translation files, outputting .po files for each fake_translations: extract_translations dummy_translations compile_translations ## generate and compile dummy translation files +ifeq ($(OPENEDX_ATLAS_PULL),) pull_translations: ## pull translations from Transifex tx pull -af -t --mode reviewed +else +# Experimental: OEP-58 Pulls translations using atlas +pull_translations: + find {{cookiecutter.project_name}}/conf/locale -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \; + atlas pull $(OPENEDX_ATLAS_ARGS) translations/{{cookiecutter.repo_name}}/{{cookiecutter.project_name}}/conf/locale:{{cookiecutter.project_name}}/conf/locale + python manage.py compilemessages + + @echo "Translations have been pulled via Atlas and compiled." +endif push_translations: ## push source translation files (.po) from Transifex tx push -s diff --git a/cookiecutter-django-ida/{{cookiecutter.repo_name}}/requirements/base.in b/cookiecutter-django-ida/{{cookiecutter.repo_name}}/requirements/base.in index 43abcc9b..45af4bae 100644 --- a/cookiecutter-django-ida/{{cookiecutter.repo_name}}/requirements/base.in +++ b/cookiecutter-django-ida/{{cookiecutter.repo_name}}/requirements/base.in @@ -11,6 +11,8 @@ edx-auth-backends edx-django-utils edx-django-release-util edx-drf-extensions +edx-i18n-tools edx-rest-api-client mysqlclient +openedx-atlas pytz diff --git a/cookiecutter-django-ida/{{cookiecutter.repo_name}}/requirements/dev.in b/cookiecutter-django-ida/{{cookiecutter.repo_name}}/requirements/dev.in index c1db14a5..d55e4a5d 100644 --- a/cookiecutter-django-ida/{{cookiecutter.repo_name}}/requirements/dev.in +++ b/cookiecutter-django-ida/{{cookiecutter.repo_name}}/requirements/dev.in @@ -4,5 +4,4 @@ -r validation.txt # Core, testing, and quality check dependencies diff-cover # Changeset diff test coverage -edx-i18n-tools # For i18n_tool dummy django-debug-toolbar # For debugging Django diff --git a/cookiecutter-django-ida/{{cookiecutter.repo_name}}/{{cookiecutter.project_name}}/conf/locale/config.yaml b/cookiecutter-django-ida/{{cookiecutter.repo_name}}/{{cookiecutter.project_name}}/conf/locale/config.yaml index d1c618e8..a968d94b 100644 --- a/cookiecutter-django-ida/{{cookiecutter.repo_name}}/{{cookiecutter.project_name}}/conf/locale/config.yaml +++ b/cookiecutter-django-ida/{{cookiecutter.repo_name}}/{{cookiecutter.project_name}}/conf/locale/config.yaml @@ -2,84 +2,3 @@ locales: - en # English - Source Language - - am # Amharic - - ar # Arabic - - az # Azerbaijani - - bg_BG # Bulgarian (Bulgaria) - - bn_BD # Bengali (Bangladesh) - - bn_IN # Bengali (India) - - bs # Bosnian - - ca # Catalan - - ca@valencia # Catalan (Valencia) - - cs # Czech - - cy # Welsh - - da # Danish - - de_DE # German (Germany) - - el # Greek - - en # English - - en_GB # English (United Kingdom) - # Don't pull these until we figure out why pages randomly display in these locales, - # when the user's browser is in English and the user is not logged in. - # - en@lolcat # LOLCAT English - # - en@pirate # Pirate English - - es_419 # Spanish (Latin America) - - es_AR # Spanish (Argentina) - - es_EC # Spanish (Ecuador) - - es_ES # Spanish (Spain) - - es_MX # Spanish (Mexico) - - es_PE # Spanish (Peru) - - et_EE # Estonian (Estonia) - - eu_ES # Basque (Spain) - - fa # Persian - - fa_IR # Persian (Iran) - - fi_FI # Finnish (Finland) - - fil # Filipino - - fr # French - - gl # Galician - - gu # Gujarati - - he # Hebrew - - hi # Hindi - - hr # Croatian - - hu # Hungarian - - hy_AM # Armenian (Armenia) - - id # Indonesian - - it_IT # Italian (Italy) - - ja_JP # Japanese (Japan) - - kk_KZ # Kazakh (Kazakhstan) - - km_KH # Khmer (Cambodia) - - kn # Kannada - - ko_KR # Korean (Korea) - - lt_LT # Lithuanian (Lithuania) - - ml # Malayalam - - mn # Mongolian - - mr # Marathi - - ms # Malay - - nb # Norwegian Bokmål - - ne # Nepali - - nl_NL # Dutch (Netherlands) - - or # Oriya - - pl # Polish - - pt_BR # Portuguese (Brazil) - - pt_PT # Portuguese (Portugal) - - ro # Romanian - - ru # Russian - - si # Sinhala - - sk # Slovak - - sl # Slovenian - - sq # Albanian - - sr # Serbian - - ta # Tamil - - te # Telugu - - th # Thai - - tr_TR # Turkish (Turkey) - - uk # Ukranian - - ur # Urdu - - uz # Uzbek - - vi # Vietnamese - - zh_CN # Chinese (China) - - zh_HK # Chinese (Hong Kong) - - zh_TW # Chinese (Taiwan) - -# The locales used for fake-accented English, for testing. -dummy_locales: - - eo