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

Master makefile targets for message catalog translations now use pybabel directly again.

Previous approach, while better in some aspects caused troubles on our automated build system, because it required for the Mentat to be correctly installed for hawat-cli to be available. (Redmine issue: #3387,#4216)
parent 7be8393c
No related branches found
No related tags found
No related merge requests found
...@@ -128,10 +128,8 @@ help: ...@@ -128,10 +128,8 @@ help:
@echo " * ${GREEN}hpybabel-init INIT_LOCALE=lc${NC}: extract and init Hawat translations for given locale $(FAINT)lc$(NC)" @echo " * ${GREEN}hpybabel-init INIT_LOCALE=lc${NC}: extract and init Hawat translations for given locale $(FAINT)lc$(NC)"
@echo " * $(GREEN)hpybabel-update$(NC): extract and update Hawat translations" @echo " * $(GREEN)hpybabel-update$(NC): extract and update Hawat translations"
@echo " * $(GREEN)hpybabel-compile$(NC): compile Hawat translations" @echo " * $(GREEN)hpybabel-compile$(NC): compile Hawat translations"
@echo " * ${GREEN}mpybabel-init INIT_LOCALE=lc${NC}: init Mentat translations for given locale $(FAINT)lc$(NC)" @echo " * ${GREEN}mpybabel-init INIT_LOCALE=lc${NC}: extract and init Mentat translations for given locale $(FAINT)lc$(NC)"
@echo " * $(GREEN)mpybabel-pull$(NC): extract and update Mentat translations" @echo " * $(GREEN)mpybabel-update$(NC): extract and update Mentat translations"
@echo " - $(ORANGE)mpybabel-extract$(NC): extract Mentat translations"
@echo " - $(ORANGE)mpybabel-update$(NC): update Mentat translations"
@echo " * $(GREEN)mpybabel-compile$(NC): compile Mentat translations" @echo " * $(GREEN)mpybabel-compile$(NC): compile Mentat translations"
@echo " * $(GREEN)translations-compile$(NC): compile all available translations" @echo " * $(GREEN)translations-compile$(NC): compile all available translations"
@echo "" @echo ""
...@@ -229,6 +227,20 @@ build-whl: clean build-webui build-package-whl ...@@ -229,6 +227,20 @@ build-whl: clean build-webui build-package-whl
# #
build-deb: clean build-webui build-package-deb build-deb: clean build-webui build-package-deb
#
#
#
install-whl: FORCE
@echo "\n${GREEN}*** Performing local installation of Python packages ***${NC}\n"
@$(PIP) install dist/mentat-ng*.whl --upgrade --force-reinstall
#
#
#
release-whl: FORCE
@echo "\n${GREEN}*** Deploying packages to PyPI ***${NC}\n"
@$(TWINE) upload dist/* --skip-existing
#=============================================================================== #===============================================================================
...@@ -455,55 +467,52 @@ pybabel-patch: FORCE ...@@ -455,55 +467,52 @@ pybabel-patch: FORCE
@cd / && patch -p0 -i /var/tmp/babel.messages.frontend.py.patch @cd / && patch -p0 -i /var/tmp/babel.messages.frontend.py.patch
# #
# Original solution that used the pybabel utility directly: # Alternative solution that uses the hawat-cli utility:
# @echo "\n$(GREEN)*** Initializing translations for new locale for Hawat user interface ***$(NC)\n" # APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl init $(INIT_LOCALE)
# @echo "Locale name: $(INIT_LOCALE)"
# @cd $(DIR_LIB_HAWAT) && $(PYBABEL) extract -F babel.cfg -o messages.pot -k lazy_gettext -k tr_ .
# @cd $(DIR_LIB_HAWAT) && $(PYBABEL) init -i messages.pot -d translations -l $(INIT_LOCALE)
# #
hpybabel-init: FORCE hpybabel-init: FORCE
APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl init $(INIT_LOCALE) @echo "\n$(GREEN)*** Initializing translations for new locale for Hawat user interface ***$(NC)\n"
@echo "Locale name: $(INIT_LOCALE)"
@$(PYBABEL) extract -F $(DIR_LIB_HAWAT)/babel.cfg -o $(DIR_LIB_HAWAT)/messages.pot -k lazy_gettext -k tr_ $(DIR_LIB)
@$(PYBABEL) init -i $(DIR_LIB_HAWAT)messages.pot -d $(DIR_LIB_HAWAT)/translations -l $(INIT_LOCALE)
# #
# Original solution that used the pybabel utility directly: # Alternative solution that uses the hawat-cli utility:
# @echo "\n$(GREEN)*** Updating translations for Hawat user interface ***$(NC)\n" # APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl update
# @cd $(DIR_LIB_HAWAT) && $(PYBABEL) extract -F babel.cfg -o messages.pot -k lazy_gettext -k tr_ .
# @cd $(DIR_LIB_HAWAT) && $(PYBABEL) update -i messages.pot -d translations
# #
hpybabel-update: FORCE hpybabel-update: FORCE
APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl update @echo "\n$(GREEN)*** Updating translations for Hawat user interface ***$(NC)\n"
@$(PYBABEL) extract -F $(DIR_LIB_HAWAT)/babel.cfg -o $(DIR_LIB_HAWAT)/messages.pot -k lazy_gettext -k tr_ $(DIR_LIB)
@$(PYBABEL) update -i $(DIR_LIB_HAWAT)/messages.pot -d $(DIR_LIB_HAWAT)/translations
# #
# Original solution that used the pybabel utility directly: # Alternative solution that uses the hawat-cli utility:
# @echo "\n$(GREEN)*** Compiling translations for Hawat user interface ***$(NC)\n" # APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl compile
# @cd $(DIR_LIB_HAWAT) && $(PYBABEL) compile -d translations
# #
hpybabel-compile: FORCE hpybabel-compile: FORCE
APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl compile @echo "\n$(GREEN)*** Compiling translations for Hawat user interface ***$(NC)\n"
@$(PYBABEL) compile -d $(DIR_LIB_HAWAT)/translations
mpybabel-extract: FORCE
@echo "\n$(GREEN)*** Extracting babel translations for Mentat ***$(NC)\n"
@$(PYBABEL) extract -F $(DIR_TEMPLATES_INFORMANT)/babel.cfg -o $(DIR_TEMPLATES_INFORMANT)/messages.pot -k lazy_gettext -k tr_ .
@$(PYBABEL) extract -F $(DIR_TEMPLATES_REPORTER)/babel.cfg -o $(DIR_TEMPLATES_REPORTER)/messages.pot -k lazy_gettext -k tr_ .
@$(PYBABEL) extract -F $(DIR_TEMPLATES_UTEST)/babel.cfg -o $(DIR_TEMPLATES_UTEST)/messages.pot -k lazy_gettext -k tr_ .
mpybabel-init: FORCE mpybabel-init: FORCE
@echo "\n$(GREEN)*** Initializing translations for new locale for Mentat ***$(NC)\n" @echo "\n$(GREEN)*** Initializing translations for new locale for Mentat ***$(NC)\n"
@echo "Locale name: $(INIT_LOCALE)" @echo "Locale name: $(INIT_LOCALE)"
@$(PYBABEL) extract -F $(DIR_TEMPLATES_INFORMANT)/babel.cfg -o $(DIR_TEMPLATES_INFORMANT)/messages.pot -k lazy_gettext -k tr_ .
@$(PYBABEL) extract -F $(DIR_TEMPLATES_REPORTER)/babel.cfg -o $(DIR_TEMPLATES_REPORTER)/messages.pot -k lazy_gettext -k tr_ .
@$(PYBABEL) extract -F $(DIR_TEMPLATES_UTEST)/babel.cfg -o $(DIR_TEMPLATES_UTEST)/messages.pot -k lazy_gettext -k tr_ .
@$(PYBABEL) init -i $(DIR_TEMPLATES_INFORMANT)/messages.pot -d $(DIR_TEMPLATES_INFORMANT)/translations -l $(INIT_LOCALE) @$(PYBABEL) init -i $(DIR_TEMPLATES_INFORMANT)/messages.pot -d $(DIR_TEMPLATES_INFORMANT)/translations -l $(INIT_LOCALE)
@$(PYBABEL) init -i $(DIR_TEMPLATES_REPORTER)/messages.pot -d $(DIR_TEMPLATES_REPORTER)/translations -l $(INIT_LOCALE) @$(PYBABEL) init -i $(DIR_TEMPLATES_REPORTER)/messages.pot -d $(DIR_TEMPLATES_REPORTER)/translations -l $(INIT_LOCALE)
@$(PYBABEL) init -i $(DIR_TEMPLATES_UTEST)/messages.pot -d $(DIR_TEMPLATES_UTEST)/translations -l $(INIT_LOCALE) @$(PYBABEL) init -i $(DIR_TEMPLATES_UTEST)/messages.pot -d $(DIR_TEMPLATES_UTEST)/translations -l $(INIT_LOCALE)
@echo ""
mpybabel-update: FORCE mpybabel-update: FORCE
@echo "\n$(GREEN)*** Updating translations for Mentat ***$(NC)\n" @echo "\n$(GREEN)*** Updating translations for Mentat ***$(NC)\n"
@$(PYBABEL) extract -F $(DIR_TEMPLATES_INFORMANT)/babel.cfg -o $(DIR_TEMPLATES_INFORMANT)/messages.pot -k lazy_gettext -k tr_ .
@$(PYBABEL) extract -F $(DIR_TEMPLATES_REPORTER)/babel.cfg -o $(DIR_TEMPLATES_REPORTER)/messages.pot -k lazy_gettext -k tr_ .
@$(PYBABEL) extract -F $(DIR_TEMPLATES_UTEST)/babel.cfg -o $(DIR_TEMPLATES_UTEST)/messages.pot -k lazy_gettext -k tr_ .
@$(PYBABEL) update -i $(DIR_TEMPLATES_INFORMANT)/messages.pot -d $(DIR_TEMPLATES_INFORMANT)/translations @$(PYBABEL) update -i $(DIR_TEMPLATES_INFORMANT)/messages.pot -d $(DIR_TEMPLATES_INFORMANT)/translations
@$(PYBABEL) update -i $(DIR_TEMPLATES_REPORTER)/messages.pot -d $(DIR_TEMPLATES_REPORTER)/translations @$(PYBABEL) update -i $(DIR_TEMPLATES_REPORTER)/messages.pot -d $(DIR_TEMPLATES_REPORTER)/translations
@$(PYBABEL) update -i $(DIR_TEMPLATES_UTEST)/messages.pot -d $(DIR_TEMPLATES_UTEST)/translations @$(PYBABEL) update -i $(DIR_TEMPLATES_UTEST)/messages.pot -d $(DIR_TEMPLATES_UTEST)/translations
mpybabel-pull: mpybabel-extract mpybabel-update
mpybabel-compile: FORCE mpybabel-compile: FORCE
@echo "\n$(GREEN)*** Compiling translations for Mentat ***$(NC)\n" @echo "\n$(GREEN)*** Compiling translations for Mentat ***$(NC)\n"
@$(PYBABEL) compile -d $(DIR_TEMPLATES_INFORMANT)/translations @$(PYBABEL) compile -d $(DIR_TEMPLATES_INFORMANT)/translations
......
...@@ -387,8 +387,8 @@ follow this procedure:: ...@@ -387,8 +387,8 @@ follow this procedure::
# When you are happy with your translations compile the message catalogs with: # When you are happy with your translations compile the message catalogs with:
(venv) $ make hpybabel-compile (venv) $ make hpybabel-compile
Similarly the ``make mpybabel-pull`` and ``make hpybabel-compile`` targets can be Similarly the ``make mpybabel-update`` and ``make hpybabel-compile`` targets can be
used to compile translations of various Mentat reports. These are located in used to compile translations of Mentat reporting templates. These are located in
following directories: following directories:
* ``conf/templates/informant/``: Report templates for :ref:`section-bin-mentat-informant`. * ``conf/templates/informant/``: Report templates for :ref:`section-bin-mentat-informant`.
......
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