Skip to content
Snippets Groups Projects
Commit 02f6a1c4 authored by Jan Mach's avatar Jan Mach
Browse files

Refactoring: Prefixed babel makefile targets related to Hawat interface with 'h'.

(Redmine issue: #3387)
parent 83b7416f
No related branches found
No related tags found
No related merge requests found
......@@ -88,7 +88,7 @@ module.exports = function(grunt) {
},
// Compile language dictionaries.
pybabel_hawat: {
command: 'make pybabel-compile'
command: 'make hpybabel-compile'
},
pybabel_mentat: {
command: 'make mpybabel-compile'
......
......@@ -64,10 +64,14 @@ help:
@echo " = ${ORANGE}docs-sync${NC}: synchronize documentation from submodules"
@echo " = ${ORANGE}docs-sphinx${NC}: generate local project documentation"
@echo " * ${GREEN}pybabel-patch${NC}: patch babel library"
@echo " * ${GREEN}pybabel-extract${NC}: extract Hawat user interface translations"
@echo " * ${GREEN}pybabel-update${NC}: update Hawat user interface translations"
@echo " * ${GREEN}pybabel-pull${NC}: extract and update Hawat user interface translations"
@echo " * ${GREEN}pybabel-compile${NC}: compile Hawat user interface translations"
@echo " * ${GREEN}hpybabel-extract${NC}: extract Hawat user interface translations"
@echo " * ${GREEN}hpybabel-update${NC}: update Hawat user interface translations"
@echo " * ${GREEN}hpybabel-pull${NC}: extract and update Hawat user interface translations"
@echo " * ${GREEN}hpybabel-compile${NC}: compile Hawat user interface translations"
@echo " * ${GREEN}mpybabel-extract${NC}: extract Mentat translations"
@echo " * ${GREEN}mpybabel-update${NC}: update Mentat translations"
@echo " * ${GREEN}mpybabel-pull${NC}: extract and update Mentat translations"
@echo " * ${GREEN}mpybabel-compile${NC}: compile Mentat translations"
@echo " * ${GREEN}check${NC}: perform extensive project checking"
@echo " = ${ORANGE}pyflakes${NC}: check project with pyflakes"
@echo " - pyflakes-bin: check executables with pyflakes"
......@@ -140,37 +144,43 @@ docs-sphinx: FORCE
#
# This patch solves following issue: https://github.com/python-babel/flask-babel/issues/43
#
pybabel-patch: FORCE
@echo "\n${GREEN}*** Patching babel library ***${NC}\n"
@cp util/babel.messages.frontend.py.patch /var/tmp/
@cd / && patch -p0 -i /var/tmp/babel.messages.frontend.py.patch
pybabel-extract: FORCE
@echo "\n${GREEN}*** Extracting babel translation for Hawat user interface ***${NC}\n"
@cd $(DIR_LIB_HAWAT) && pybabel-python3 extract -F babel.cfg -o messages.pot -k lazy_gettext .
#
# When doing translation into another language, you may use following command to
# initialize the translations directory:
#
# 1. Enter directory containing the messages.pot file.
# 2. pybabel-python3 init -i messages.pot -d translations -l [locale]
#
#pybabel-init: FORCE
# @echo "\n${GREEN}*** Initializing translation for Hawat user interface ***${NC}\n"
# @cd $(DIR_LIB_HAWAT) && pybabel-python3 init -i messages.pot -d translations -l cs
hpybabel-extract: FORCE
@echo "\n${GREEN}*** Extracting babel translations for Hawat user interface ***${NC}\n"
@cd $(DIR_LIB_HAWAT) && pybabel-python3 extract -F babel.cfg -o messages.pot -k lazy_gettext .
pybabel-update: FORCE
hpybabel-update: FORCE
@echo "\n${GREEN}*** Updating translations for Hawat user interface ***${NC}\n"
@cd $(DIR_LIB_HAWAT) && pybabel-python3 update -i messages.pot -d translations -l cs
pybabel-pull: pybabel-extract pybabel-update
hpybabel-pull: hpybabel-extract hpybabel-update
pybabel-compile: FORCE
hpybabel-compile: FORCE
@echo "\n${GREEN}*** Compiling translations for Hawat user interface ***${NC}\n"
@cd $(DIR_LIB_HAWAT) && pybabel-python3 compile -d translations
mpybabel-extract: FORCE
@echo "\n${GREEN}*** Extracting babel translation for Mentat reports ***${NC}\n"
@echo "\n${GREEN}*** Extracting babel translations for Mentat ***${NC}\n"
@pybabel-python3 extract -F $(DIR_TEMPLATES_INFORMANT)/babel.cfg -o $(DIR_TEMPLATES_INFORMANT)/messages.pot -k lazy_gettext -k tr_ .
@pybabel-python3 extract -F $(DIR_TEMPLATES_REPORTER)/babel.cfg -o $(DIR_TEMPLATES_REPORTER)/messages.pot -k lazy_gettext -k tr_ .
@pybabel-python3 extract -F $(DIR_TEMPLATES_UTEST)/babel.cfg -o $(DIR_TEMPLATES_UTEST)/messages.pot -k lazy_gettext -k tr_ .
mpybabel-update: FORCE
@echo "\n${GREEN}*** Updating translations for Mentat reports ***${NC}\n"
@echo "\n${GREEN}*** Updating translations for Mentat ***${NC}\n"
@pybabel-python3 update -i $(DIR_TEMPLATES_INFORMANT)/messages.pot -d $(DIR_TEMPLATES_INFORMANT)/translations -l cs
@pybabel-python3 update -i $(DIR_TEMPLATES_REPORTER)/messages.pot -d $(DIR_TEMPLATES_REPORTER)/translations -l cs
@pybabel-python3 update -i $(DIR_TEMPLATES_UTEST)/messages.pot -d $(DIR_TEMPLATES_UTEST)/translations -l cs
......@@ -178,7 +188,7 @@ mpybabel-update: FORCE
mpybabel-pull: mpybabel-extract mpybabel-update
mpybabel-compile: FORCE
@echo "\n${GREEN}*** Compiling translations for Mentat reports ***${NC}\n"
@echo "\n${GREEN}*** Compiling translations for Mentat ***${NC}\n"
@pybabel-python3 compile -d $(DIR_TEMPLATES_INFORMANT)/translations
@pybabel-python3 compile -d $(DIR_TEMPLATES_REPORTER)/translations
@pybabel-python3 compile -d $(DIR_TEMPLATES_UTEST)/translations
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment