Skip to content

Commit

Permalink
feat: add atlas support for cookiecutter-django-ida (#409)
Browse files Browse the repository at this point in the history
Update cookiecutter-django-ida to support atlas for all new IDA. Doing that
behind a feature flag until it's fully implemented

Refs: FC-0012 OEP-58
  • Loading branch information
shadinaif authored Jan 10, 2024
1 parent 8180c89 commit d3d1326
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 85 deletions.
15 changes: 12 additions & 3 deletions cookiecutter-django-ida/{{cookiecutter.repo_name}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d3d1326

Please sign in to comment.