Skip to content

Commit

Permalink
feat: standardize make extract_translations
Browse files Browse the repository at this point in the history
Refs: FC-0012 OEP-58
  • Loading branch information
shadinaif committed May 9, 2023
1 parent c0672fc commit 41a31a5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ endef
export BROWSER_PYSCRIPT
BROWSER := python -c "$$BROWSER_PYSCRIPT"

EXTRACT_DIR := enterprise/conf/locale/en/LC_MESSAGES
EXTRACTED_DJANGO_PARTIAL := $(EXTRACT_DIR)/django-partial.po
EXTRACTED_DJANGO := $(EXTRACT_DIR)/django.po


help: ## display this help message
@echo "Please use \`make <target>' where <target> is one of"
@perl -nle'print $& if m{^[\.a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}'
Expand Down Expand Up @@ -45,15 +50,16 @@ static.watch: ## watch for static asset changes for a development environment
$(NODE_BIN)/webpack --config webpack.config.js --display-error-details --progress --watch

compile_translations: ## compile translation files, outputting .po files for each supported language
./manage.py compilemessages
django-admin compilemessages

dummy_translations: ## generate dummy translation (.po) files
cd enterprise && i18n_tool dummy

extract_translations: ## extract strings to be translated, outputting .mo files
rm -rf docs/_build
./manage.py makemessages -l en -v1 -d django
./manage.py makemessages -l en -v1 -d djangojs -i "node_modules/*"
i18n_tool extract
msgmerge -U $(EXTRACTED_DJANGO) $(EXTRACTED_DJANGO_PARTIAL)
rm $(EXTRACTED_DJANGO_PARTIAL)

fake_translations: extract_translations dummy_translations compile_translations ## generate and compile dummy translation files

Expand Down

0 comments on commit 41a31a5

Please sign in to comment.