Skip to content
Snippets Groups Projects
Commit 09103478 authored by Jan Zerdik's avatar Jan Zerdik
Browse files

Allowing regenerate translations on production installed Mentat instance.

(Redmine issue: #6222)
parent bf269212
No related branches found
No related tags found
No related merge requests found
include LICENSE.txt include LICENSE.txt
include README.rst include README.rst
include lib/hawat/Makefile*
recursive-include lib/hawat/static * recursive-include lib/hawat/static *
recursive-include lib/hawat/templates * recursive-include lib/hawat/templates *
recursive-include lib/hawat/migrations * recursive-include lib/hawat/migrations *
......
...@@ -26,11 +26,11 @@ DIR_DOC = doc ...@@ -26,11 +26,11 @@ DIR_DOC = doc
DIR_LIB = lib DIR_LIB = lib
DIR_LIB_HAWAT = lib/hawat DIR_LIB_HAWAT = lib/hawat
DIR_TEMPLATES_INFORMANT = conf/templates/informant DIR_TEMPLATES_INFORMANT = $(shell pwd)/conf/templates/informant
DIR_TEMPLATES_REPORTER = conf/templates/reporter DIR_TEMPLATES_REPORTER = $(shell pwd)/conf/templates/reporter
DIR_TEMPLATES_UTEST = conf/templates/utest DIR_TEMPLATES_UTEST = $(shell pwd)/conf/templates/utest
DIR_EVENT_CLASSES = conf/event_classes DIR_EVENT_CLASSES = $(shell pwd)/conf/event_classes
BIN_FILES := $(wildcard bin/mentat-*.py) BIN_FILES := $(wildcard bin/mentat-*.py)
LIB_FILES := $(shell find $(DIR_LIB) -name '*.py' | grep -v 'test_') LIB_FILES := $(shell find $(DIR_LIB) -name '*.py' | grep -v 'test_')
...@@ -43,7 +43,6 @@ PIP = pip ...@@ -43,7 +43,6 @@ PIP = pip
NOSETESTS = nosetests NOSETESTS = nosetests
COVERAGE = coverage COVERAGE = coverage
TWINE = twine TWINE = twine
PYBABEL = pybabel
CURRENT_DIR = $(shell pwd) CURRENT_DIR = $(shell pwd)
...@@ -55,7 +54,7 @@ DEV_MAIL_PORT = 8025 ...@@ -55,7 +54,7 @@ DEV_MAIL_PORT = 8025
# #
# Include common makefile configurations. # Include common makefile configurations.
# #
include Makefile.inc include ${DIR_LIB_HAWAT}/Makefile.inc
# #
# Include local customized configurations. # Include local customized configurations.
...@@ -476,88 +475,47 @@ presentations: FORCE ...@@ -476,88 +475,47 @@ presentations: FORCE
# Apply when necessary. # Apply when necessary.
# #
pybabel-patch: FORCE pybabel-patch: FORCE
@echo "\n$(GREEN)*** Patching babel library ***$(NC)\n" make -C $(DIR_LIB_HAWAT) pybabel-patch
@cp util/babel.messages.frontend.py.patch /var/tmp/
@cd / && patch -p0 -i /var/tmp/babel.messages.frontend.py.patch
cpybabel-init: FORCE cpybabel-init: FORCE
@echo "\n$(GREEN)*** Initializing translations for new locale for event_classes ***$(NC)\n" make -C $(DIR_LIB_HAWAT) cpybabel-init INIT_LOCALE=$(INIT_LOCALE) DIR_EVENT_CLASSES=$(DIR_EVENT_CLASSES)
@echo "Locale name: $(INIT_LOCALE)"
@for class in $(DIR_EVENT_CLASSES)/*/; do \
$(PYBABEL) extract -F $(DIR_EVENT_CLASSES)/babel.cfg -o ${class}messages.pot -k lazy_gettext -k tr_ --no-location $${class}; \
$(PYBABEL) init -i $${class}messages.pot -d $${class}translations -l $(INIT_LOCALE); \
done
cpybabel-update: FORCE cpybabel-update: FORCE
@echo "\n$(GREEN)*** Updating translations for event_classes ***$(NC)\n" make -C $(DIR_LIB_HAWAT) cpybabel-update DIR_EVENT_CLASSES=$(DIR_EVENT_CLASSES)
@for class in $(DIR_EVENT_CLASSES)/*/; do \
$(PYBABEL) extract -F $(DIR_EVENT_CLASSES)/babel.cfg -o $${class}messages.pot --no-location $${class}; \
$(PYBABEL) update -i $${class}messages.pot -d $${class}translations; \
done
cpybabel-compile: FORCE cpybabel-compile: FORCE
@echo "\n$(GREEN)*** Compiling translations for event_classes ***$(NC)\n" make -C $(DIR_LIB_HAWAT) cpybabel-compile DIR_EVENT_CLASSES=$(DIR_EVENT_CLASSES)
@for class in $(DIR_EVENT_CLASSES)/*/; do \
$(PYBABEL) compile -d $${class}translations; \
done
#\ #\
# Alternative solution that uses the hawat-cli utility: # Alternative solution that uses the hawat-cli utility:
# APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl init $(INIT_LOCALE) # APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl init $(INIT_LOCALE)
# #
hpybabel-init: cpybabel-init hpybabel-init:
@echo "\n$(GREEN)*** Initializing translations for new locale for Hawat user interface ***$(NC)\n" make -C $(DIR_LIB_HAWAT) hpybabel-init INIT_LOCALE=$(INIT_LOCALE) DIR_EVENT_CLASSES=$(DIR_EVENT_CLASSES)
@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) extract -F $(DIR_TEMPLATES_REPORTER)/babel.cfg -o $(DIR_TEMPLATES_REPORTER)/messages.pot -k lazy_gettext -k tr_ --no-location .
@$(PYBABEL) init -i $(DIR_LIB_HAWAT)/messages.pot -d $(DIR_LIB_HAWAT)/translations -l $(INIT_LOCALE)
@$(PYBABEL) init -i $(DIR_TEMPLATES_REPORTER)/messages.pot -d $(DIR_TEMPLATES_REPORTER)/translations -l $(INIT_LOCALE)
# #
# Alternative solution that uses the hawat-cli utility: # Alternative solution that uses the hawat-cli utility:
# APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl update # APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl update
# #
hpybabel-update: cpybabel-update hpybabel-update:
@echo "\n$(GREEN)*** Updating translations for Hawat user interface ***$(NC)\n" make -C $(DIR_LIB_HAWAT) hpybabel-update DIR_EVENT_CLASSES=$(DIR_EVENT_CLASSES) DIR_TEMPLATES_REPORTER=$(DIR_TEMPLATES_REPORTER)
@$(PYBABEL) extract -F $(DIR_LIB_HAWAT)/babel.cfg -o $(DIR_LIB_HAWAT)/messages.pot -k lazy_gettext -k tr_ $(DIR_LIB)
@$(PYBABEL) extract -F $(DIR_TEMPLATES_REPORTER)/babel.cfg -o $(DIR_TEMPLATES_REPORTER)/messages.pot -k lazy_gettext -k tr_ --no-location .
@$(PYBABEL) update -i $(DIR_LIB_HAWAT)/messages.pot -d $(DIR_LIB_HAWAT)/translations
@$(PYBABEL) update -i $(DIR_TEMPLATES_REPORTER)/messages.pot -d $(DIR_TEMPLATES_REPORTER)/translations -l cs
# #
# Alternative solution that uses the hawat-cli utility: # Alternative solution that uses the hawat-cli utility:
# APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl compile # APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl compile
# #
hpybabel-compile: cpybabel-compile hpybabel-compile:
@echo "\n$(GREEN)*** Compiling translations for Hawat user interface ***$(NC)\n" make -C $(DIR_LIB_HAWAT) hpybabel-compile DIR_EVENT_CLASSES=$(DIR_EVENT_CLASSES) DIR_TEMPLATES_REPORTER=$(DIR_TEMPLATES_REPORTER)
@$(PYBABEL) compile -d $(DIR_LIB_HAWAT)/translations
@$(PYBABEL) compile -d $(DIR_TEMPLATES_REPORTER)/translations
mpybabel-init:
make -C $(DIR_LIB_HAWAT) mpybabel-init INIT_LOCALE=$(INIT_LOCALE) DIR_EVENT_CLASSES=$(DIR_EVENT_CLASSES) DIR_TEMPLATES_INFORMANT=$(DIR_TEMPLATES_INFORMANT) DIR_TEMPLATES_REPORTER=$(DIR_TEMPLATES_REPORTER) DIR_TEMPLATES_UTEST=$(DIR_TEMPLATES_UTEST)
mpybabel-init: cpybabel-init
@echo "\n$(GREEN)*** Initializing translations for new locale for Mentat ***$(NC)\n" mpybabel-update:
@echo "Locale name: $(INIT_LOCALE)" make -C $(DIR_LIB_HAWAT) mpybabel-update DIR_EVENT_CLASSES=$(DIR_EVENT_CLASSES) DIR_TEMPLATES_INFORMANT=$(DIR_TEMPLATES_INFORMANT) DIR_TEMPLATES_REPORTER=$(DIR_TEMPLATES_REPORTER) DIR_TEMPLATES_UTEST=$(DIR_TEMPLATES_UTEST)
@$(PYBABEL) extract -F $(DIR_TEMPLATES_INFORMANT)/babel.cfg -o $(DIR_TEMPLATES_INFORMANT)/messages.pot -k lazy_gettext -k tr_ --no-location .
@$(PYBABEL) extract -F $(DIR_TEMPLATES_REPORTER)/babel.cfg -o $(DIR_TEMPLATES_REPORTER)/messages.pot -k lazy_gettext -k tr_ --no-location . mpybabel-compile:
@$(PYBABEL) extract -F $(DIR_TEMPLATES_UTEST)/babel.cfg -o $(DIR_TEMPLATES_UTEST)/messages.pot -k lazy_gettext -k tr_ --no-location . make -C $(DIR_LIB_HAWAT) mpybabel-compile DIR_EVENT_CLASSES=$(DIR_EVENT_CLASSES) DIR_TEMPLATES_INFORMANT=$(DIR_TEMPLATES_INFORMANT) DIR_TEMPLATES_REPORTER=$(DIR_TEMPLATES_REPORTER) DIR_TEMPLATES_UTEST=$(DIR_TEMPLATES_UTEST)
@$(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_UTEST)/messages.pot -d $(DIR_TEMPLATES_UTEST)/translations -l $(INIT_LOCALE)
mpybabel-update: cpybabel-update
@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_ --no-location .
@$(PYBABEL) extract -F $(DIR_TEMPLATES_REPORTER)/babel.cfg -o $(DIR_TEMPLATES_REPORTER)/messages.pot -k lazy_gettext -k tr_ --no-location .
@$(PYBABEL) extract -F $(DIR_TEMPLATES_UTEST)/babel.cfg -o $(DIR_TEMPLATES_UTEST)/messages.pot -k lazy_gettext -k tr_ --no-location .
@$(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_UTEST)/messages.pot -d $(DIR_TEMPLATES_UTEST)/translations
mpybabel-compile: cpybabel-compile
@echo "\n$(GREEN)*** Compiling translations for Mentat ***$(NC)\n"
@$(PYBABEL) compile -d $(DIR_TEMPLATES_INFORMANT)/translations --statistics
@$(PYBABEL) compile -d $(DIR_TEMPLATES_REPORTER)/translations --statistics
@$(PYBABEL) compile -d $(DIR_TEMPLATES_UTEST)/translations --statistics
# #
# Compile all available translations. # Compile all available translations.
......
[python: lib/mentat/const.py] [python: {DIR_LIB}/mentat/const.py]
[python: lib/mentat/reports/base.py] [python: {DIR_LIB}/mentat/reports/base.py]
[python: lib/mentat/reports/overview.py] [python: {DIR_LIB}/mentat/reports/overview.py]
[jinja2: conf/templates/informant/**.j2] [jinja2: {DIR_TEMPLATES_INFORMANT}/**.j2]
extensions=jinja2.ext.autoescape,jinja2.ext.with_ extensions=jinja2.ext.autoescape,jinja2.ext.with_
[python: lib/mentat/const.py] [python: {DIR_LIB}/mentat/const.py]
[python: lib/mentat/reports/base.py] [python: {DIR_LIB}/mentat/reports/base.py]
[python: lib/mentat/reports/event.py] [python: {DIR_LIB}/mentat/reports/event.py]
[jinja2: conf/templates/reporter/**.j2] [jinja2: {DIR_TEMPLATES_REPORTER}/**.j2]
extensions=jinja2.ext.autoescape,jinja2.ext.with_ extensions=jinja2.ext.autoescape,jinja2.ext.with_
[python: lib/mentat/reports/base.py] [python: {DIR_LIB}/mentat/reports/base.py]
[jinja2: conf/templates/utest/**.j2] [jinja2: {DIR_TEMPLATES_UTEST}/**.j2]
extensions=jinja2.ext.autoescape,jinja2.ext.with_ extensions=jinja2.ext.autoescape,jinja2.ext.with_
#-------------------------------------------------------------------------------
# MASTER MAKEFILE FOR MENTAT-NG PROJECT
#
# This file is part of Mentat system (https://mentat.cesnet.cz/).
#
# Copyright (C) since 2011 CESNET, z.s.p.o (http://www.ces.net/)
# Author: Jan Mach <jan.mach@cesnet.cz>
# Use of this source is governed by an MIT license, see LICENSE file.
#-------------------------------------------------------------------------------
#
# Default make target, alias for 'help', you must explicitly choose the target.
#
default: help
#===============================================================================
PYBABEL = pybabel
DIR_LIB = $(shell pwd)/..
DIR_LIB_HAWAT = $(shell pwd)
DIR_TEMPLATES_INFORMANT ?= /etc/mentat/templates/informant
DIR_TEMPLATES_REPORTER ?= /etc/mentat/templates/reporter
DIR_TEMPLATES_UTEST ?= /etc/mentat/templates/utest
DIR_EVENT_CLASSES ?= /etc/mentat/event_classes/
TMP_BABEL_CONF = /tmp/babel_tmp.cfg
#
# Include common makefile configurations.
#
include Makefile.inc
#===============================================================================
#
# Display extensive help information page.
#
help:
@echo ""
@echo " ███╗ ███╗███████╗███╗ ██╗████████╗ █████╗ ████████╗"
@echo " ████╗ ████║██╔════╝████╗ ██║╚══██╔══╝██╔══██╗╚══██╔══╝"
@echo " ██╔████╔██║█████╗ ██╔██╗ ██║ ██║ ███████║ ██║"
@echo " ██║╚██╔╝██║██╔══╝ ██║╚██╗██║ ██║ ██╔══██║ ██║"
@echo " ██║ ╚═╝ ██║███████╗██║ ╚████║ ██║ ██║ ██║ ██║"
@echo " ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝"
@echo " $(FAINT)Copyright (C) since 2011 CESNET, z.s.p.o$(NC)"
@echo ""
@echo " $(GREEN)$(BOLD)╔══════════════════════════════════════════════════════════════════════════════════╗$(NC)"
@echo " $(GREEN)$(BOLD)║ LIST OF AVAILABLE MAKE TARGETS ║$(NC)"
@echo " $(GREEN)$(BOLD)╚══════════════════════════════════════════════════════════════════════════════════╝$(NC)"
@echo ""
@echo " * $(GREEN)pybabel-patch$(NC): patch babel library"
@echo " * ${GREEN}cpybabel-init INIT_LOCALE=lc${NC}: extract and init event_classes translations for given locale $(FAINT)lc$(NC)"
@echo " * $(GREEN)cpybabel-update$(NC): extract and update event_classes translations"
@echo " * $(GREEN)cpybabel-compile$(NC): compile event_classes translations"
@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-compile$(NC): compile Hawat translations"
@echo " * ${GREEN}mpybabel-init INIT_LOCALE=lc${NC}: extract and init Mentat translations for given locale $(FAINT)lc$(NC)"
@echo " * $(GREEN)mpybabel-update$(NC): extract and update Mentat translations"
@echo " * $(GREEN)mpybabel-compile$(NC): compile Mentat translations"
@echo " * $(GREEN)translations-compile$(NC): compile all available translations"
@echo ""
@echo " $(GREEN)════════════════════════════════════════════════════════════════════════════════════$(NC)"
@echo ""
#-------------------------------------------------------------------------------
#
# This patch solves following issue: https://github.com/python-babel/flask-babel/issues/43
# Apply when necessary.
#
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
cpybabel-init: FORCE
@echo "\n$(GREEN)*** Initializing translations for new locale for event_classes ***$(NC)\n"
@echo "Locale name: $(INIT_LOCALE)"
@for class in $(DIR_EVENT_CLASSES)/*/; do \
if [ ! -f $${class}translations/$${INIT_LOCALE}/LC_MESSAGES/messages.po ]; then \
$(PYBABEL) extract -F $(DIR_EVENT_CLASSES)/babel.cfg -o $${class}messages.pot -k lazy_gettext -k tr_ --no-location $${class}; \
$(PYBABEL) init -i $${class}messages.pot -d $${class}translations -l $(INIT_LOCALE); \
fi \
done
cpybabel-update: FORCE
@echo "\n$(GREEN)*** Updating translations for event_classes $(DIR_EVENT_CLASSES) ***$(NC)\n"
@for class in $(DIR_EVENT_CLASSES)/*/; do \
$(PYBABEL) extract -F $(DIR_EVENT_CLASSES)/babel.cfg -o $${class}messages.pot --no-location $${class}; \
$(PYBABEL) update -i $${class}messages.pot -d $${class}translations; \
done
cpybabel-compile: FORCE
@echo "\n$(GREEN)*** Compiling translations for event_classes ***$(NC)\n"
@for class in $(DIR_EVENT_CLASSES)/*/; do \
$(PYBABEL) compile -d $${class}translations; \
done
aaa:
@echo $(ESCAPED_DIR_TEMPLATES_INFORMANT)
@echo $(DIR_LIB) | sed 's/\//\\\//g'
@echo $(echo aaaaa)
@echo 's/{DIR_LIB}/'echo aaa'/g'
@echo 's/{DIR_LIB}/$(echo $(DIR_LIB) | sed -e 's/\//\\\//g')/g'
@cat $(DIR_TEMPLATES_REPORTER)/babel.cfg | sed 's,{DIR_LIB},$(DIR_LIB),g' | sed 's,{DIR_TEMPLATES_REPORTER},${DIR_TEMPLATES_REPORTER},g' > $(TMP_BABEL_CONF)
#
# Alternative solution that uses the hawat-cli utility:
# APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl init $(INIT_LOCALE)
#
hpybabel-init: cpybabel-init
@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)
@cat $(DIR_TEMPLATES_REPORTER)/babel.cfg | sed -e 's,{DIR_LIB},$(shell realpath ${DIR_LIB} | cut -c2-),g' -e 's,{DIR_TEMPLATES_REPORTER},$(shell realpath ${DIR_TEMPLATES_REPORTER} | cut -c2-),g' > $(TMP_BABEL_CONF)
$(PYBABEL) extract -F $(TMP_BABEL_CONF) -o $(DIR_TEMPLATES_REPORTER)/messages.pot -k lazy_gettext -k tr_ --no-location /
@rm $(TMP_BABEL_CONF)
@$(PYBABEL) init -i $(DIR_LIB_HAWAT)/messages.pot -d $(DIR_LIB_HAWAT)/translations -l $(INIT_LOCALE)
@$(PYBABEL) init -i $(DIR_TEMPLATES_REPORTER)/messages.pot -d $(DIR_TEMPLATES_REPORTER)/translations -l $(INIT_LOCALE)
#
# Alternative solution that uses the hawat-cli utility:
# APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl update
#
hpybabel-update: cpybabel-update
@echo "\n$(GREEN)*** Updating translations for Hawat user interface ***$(NC) $(DIR_LIB_HAWAT)\n"
@$(PYBABEL) extract -F $(DIR_LIB_HAWAT)/babel.cfg -o $(DIR_LIB_HAWAT)/messages.pot -k lazy_gettext -k tr_ $(DIR_LIB)
@cat $(DIR_TEMPLATES_REPORTER)/babel.cfg | sed -e 's,{DIR_LIB},$(shell realpath ${DIR_LIB} | cut -c2-),g' -e 's,{DIR_TEMPLATES_REPORTER},$(shell realpath ${DIR_TEMPLATES_REPORTER} | cut -c2-),g' > $(TMP_BABEL_CONF)
@$(PYBABEL) extract -F $(TMP_BABEL_CONF) -o $(DIR_TEMPLATES_REPORTER)/messages.pot -k lazy_gettext -k tr_ --no-location /
@rm $(TMP_BABEL_CONF)
@$(PYBABEL) update -i $(DIR_LIB_HAWAT)/messages.pot -d $(DIR_LIB_HAWAT)/translations
@$(PYBABEL) update -i $(DIR_TEMPLATES_REPORTER)/messages.pot -d $(DIR_TEMPLATES_REPORTER)/translations
#
# Alternative solution that uses the hawat-cli utility:
# APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl compile
#
hpybabel-compile: cpybabel-compile
@echo "\n$(GREEN)*** Compiling translations for Hawat user interface ***$(NC)\n"
@$(PYBABEL) compile -d $(DIR_LIB_HAWAT)/translations
@$(PYBABEL) compile -d $(DIR_TEMPLATES_REPORTER)/translations
mpybabel-init: cpybabel-init
@echo "\n$(GREEN)*** Initializing translations for new locale for Mentat ***$(NC)\n"
@echo "Locale name: $(INIT_LOCALE)"
@cat $(DIR_TEMPLATES_INFORMANT)/babel.cfg | sed -e 's,{DIR_LIB},$(shell realpath ${DIR_LIB} | cut -c2-),g' -e 's,{DIR_TEMPLATES_INFORMANT},$(shell realpath ${DIR_TEMPLATES_INFORMANT} | cut -c2-),g' > $(TMP_BABEL_CONF)
@$(PYBABEL) extract -F $(TMP_BABEL_CONF) -o $(DIR_TEMPLATES_INFORMANT)/messages.pot -k lazy_gettext -k tr_ --no-location /
@cat $(DIR_TEMPLATES_REPORTER)/babel.cfg | sed -e 's,{DIR_LIB},$(shell realpath ${DIR_LIB} | cut -c2-),g' -e 's,{DIR_TEMPLATES_REPORTER},$(shell realpath ${DIR_TEMPLATES_REPORTER} | cut -c2-),g' > $(TMP_BABEL_CONF)
@$(PYBABEL) extract -F $(TMP_BABEL_CONF) -o $(DIR_TEMPLATES_REPORTER)/messages.pot -k lazy_gettext -k tr_ --no-location /
@cat $(DIR_TEMPLATES_UTEST)/babel.cfg | sed -e 's,{DIR_LIB},$(shell realpath ${DIR_LIB} | cut -c2-),g' -e 's,{DIR_TEMPLATES_UTEST},$(shell realpath ${DIR_TEMPLATES_UTEST} | cut -c2-),g' > $(TMP_BABEL_CONF)
@$(PYBABEL) extract -F $(TMP_BABEL_CONF) -o $(DIR_TEMPLATES_UTEST)/messages.pot -k lazy_gettext -k tr_ --no-location /
@$(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_UTEST)/messages.pot -d $(DIR_TEMPLATES_UTEST)/translations -l $(INIT_LOCALE)
@rm $(TMP_BABEL_CONF)
mpybabel-update: cpybabel-update
@echo "\n$(GREEN)*** Updating translations for Mentat ***$(NC)\n"
@cat $(DIR_TEMPLATES_INFORMANT)/babel.cfg | sed -e 's,{DIR_LIB},$(shell realpath ${DIR_LIB} | cut -c2-),g' -e 's,{DIR_TEMPLATES_INFORMANT},$(shell realpath ${DIR_TEMPLATES_INFORMANT} | cut -c2-),g' > $(TMP_BABEL_CONF)
@$(PYBABEL) extract -F $(TMP_BABEL_CONF) -o $(DIR_TEMPLATES_INFORMANT)/messages.pot -k lazy_gettext -k tr_ --no-location /
@cat $(DIR_TEMPLATES_REPORTER)/babel.cfg | sed -e 's,{DIR_LIB},$(shell realpath ${DIR_LIB} | cut -c2-),g' -e 's,{DIR_TEMPLATES_REPORTER},$(shell realpath ${DIR_TEMPLATES_REPORTER} | cut -c2-),g' > $(TMP_BABEL_CONF)
@$(PYBABEL) extract -F $(TMP_BABEL_CONF) -o $(DIR_TEMPLATES_REPORTER)/messages.pot -k lazy_gettext -k tr_ --no-location /
@cat $(DIR_TEMPLATES_UTEST)/babel.cfg | sed -e 's,{DIR_LIB},$(shell realpath ${DIR_LIB} | cut -c2-),g' -e 's,{DIR_TEMPLATES_UTEST},$(shell realpath ${DIR_TEMPLATES_UTEST} | cut -c2-),g' > $(TMP_BABEL_CONF)
@$(PYBABEL) extract -F $(TMP_BABEL_CONF) -o $(DIR_TEMPLATES_UTEST)/messages.pot -k lazy_gettext -k tr_ --no-location /
@$(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_UTEST)/messages.pot -d $(DIR_TEMPLATES_UTEST)/translations
@rm $(TMP_BABEL_CONF)
mpybabel-compile: cpybabel-compile
@echo "\n$(GREEN)*** Compiling translations for Mentat ***$(NC)\n"
@$(PYBABEL) compile -d $(DIR_TEMPLATES_INFORMANT)/translations --statistics
@$(PYBABEL) compile -d $(DIR_TEMPLATES_REPORTER)/translations --statistics
@$(PYBABEL) compile -d $(DIR_TEMPLATES_UTEST)/translations --statistics
#
# Compile all available translations.
#
translations-compile: hpybabel-compile mpybabel-compile
# Empty rule as dependency will force make to always perform target
# Source: https://www.gnu.org/software/make/manual/html_node/Force-Targets.html
FORCE:
File moved
[python: **.py] [python: hawat/**.py]
[jinja2: **/templates/**.html] [python: mentat/**.py]
[jinja2: **/templates/**.txt] [python: vial/**.py]
[jinja2: hawat/**/templates/**.html]
[jinja2: hawat/**/templates/**.txt]
extensions=jinja2.ext.autoescape,jinja2.ext.with_ extensions=jinja2.ext.autoescape,jinja2.ext.with_
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