changeset 2057:84d88fbd6007 unify_imports

Merged default into branch.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 28 Jan 2019 19:30:03 +0100
parents 0a401d81c6a6 (current diff) a1164d2e23e1 (diff)
children 09f9ae3d0526
files
diffstat 1 files changed, 3 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/client/Makefile	Mon Jan 28 14:12:15 2019 +0100
+++ b/client/Makefile	Mon Jan 28 19:30:03 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; \