Mercurial > gemma
changeset 2013:a1164d2e23e1
client: translations: get improvments on Makefile from upstream
* stop using xgettext and use easygettext instead which is better
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Mon, 28 Jan 2019 16:26:32 +0100 |
parents | ce294a8635a5 |
children | 958a0183fa3d 84d88fbd6007 |
files | client/Makefile |
diffstat | 1 files changed, 3 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/client/Makefile Fri Jan 25 13:09:17 2019 +0100 +++ b/client/Makefile Mon Jan 28 16:26:32 2019 +0100 @@ -25,8 +25,7 @@ # Name of the generated .po files for each available locale. LOCALE_FILES ?= $(patsubst %,$(OUTPUT_DIR)/locale/%/LC_MESSAGES/app.po,$(LOCALES)) -GETTEXT_HTML_SOURCES = $(shell find $(OUTPUT_DIR) -name '*.vue' -o -name '*.html' 2> /dev/null) -GETTEXT_JS_SOURCES = $(shell find $(OUTPUT_DIR) -name '*.vue' -o -name '*.js' 2> /dev/null) +GETTEXT_SOURCES ?= $(shell find $(OUTPUT_DIR) -name '*.html' -o -name '*.js' -o -name '*.vue' 2> /dev/null) # Makefile Targets .PHONY: clean makemessages translations all @@ -43,20 +42,13 @@ # Create a main .pot template, then generate .po files for each available language. # Thanx to Systematic: https://github.com/Polyconseil/systematic/blob/866d5a/mk/main.mk#L167-L183 -$(TEMPLATE_POT): $(GETTEXT_HTML_SOURCES) $(GETTEXT_JS_SOURCES) +$(TEMPLATE_POT): $(GETTEXT_SOURCES) # `dir` is a Makefile built-in expansion function which extracts the directory-part of `$@`. # `$@` is a Makefile automatic variable: the file name of the target of the rule. # => `mkdir -p /tmp/` mkdir -p $(dir $@) - which gettext-extract # Extract gettext strings from templates files and create a POT dictionary template. - gettext-extract --attribute v-translate --quiet --output $@ $(GETTEXT_HTML_SOURCES) -# Extract gettext strings from JavaScript files. - xgettext --language=JavaScript --keyword=npgettext:1c,2,3 \ - --from-code=utf-8 --join-existing --no-wrap \ - --package-name=$(shell node -e "console.log(require('./package.json').name);") \ - --package-version=$(shell node -e "console.log(require('./package.json').version);") \ - --output $@ $(GETTEXT_JS_SOURCES) + gettext-extract --quiet --attribute v-translate --output $@ $(GETTEXT_SOURCES) # Generate .po files for each available language. @for lang in $(LOCALES); do \ export PO_FILE=$(OUTPUT_DIR)/locale/$$lang/LC_MESSAGES/app.po; \