Skip to content

Commit

Permalink
🌐 Add Makefile to run the tasks easily (#11)
Browse files Browse the repository at this point in the history
Makefile with four instructions: extract, init, update and compile. This makes easier to run the necessary tasks to work with the translations.
  • Loading branch information
ivanhercaz committed Dec 8, 2019
1 parent 92d8e4a commit 1cfdc83
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
help:
@echo "Makefile to ease the translation process"
@echo "Usage:"
@echo " make extract Extract message strings."
@echo " make init lang=LANG_CODE Create catalog (po file)."
@echo " make update Extract and update po files."
@echo " make compile Compile po files to mo files."

extract:
pybabel extract --mapping babel.cfg --output messages.pot ./

init:
pybabel init --input-file translations/messages.pot --output-dir translations/ --locale $(lang) --domain messages

update:
pybabel update --input-file messages.pot --output-dir translations/ --domain messages

compile:
pybabel compile --directory translations/ --domain messages

0 comments on commit 1cfdc83

Please sign in to comment.