From e53032ab9c9e513be44d1c10ac7ea457f70eaabf Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sat, 22 Feb 2025 08:41:13 +0000 Subject: [PATCH] gettext.mk: Support GETTEXT_INPUT_EXTS GETTEXT_INPUT_EXTS takes a whitespace separated list of extensions which are subsequently passed to find -name to locate source files which are meant to be run through xgettext. The first argument to find, translateme, is not really meant to exist, it's just there to allow adding multiple extensions preceded by -o in a $(foreach) loop. Signed-off-by: Jan Lindemann --- make/gettext.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/make/gettext.mk b/make/gettext.mk index 413b4dd9..184b7ef0 100644 --- a/make/gettext.mk +++ b/make/gettext.mk @@ -11,8 +11,9 @@ GETTEXT_POT ?= $(wildcard *.pot) GETTEXT_PO ?= $(patsubst %.pot,%.po,$(GETTEXT_POT)) GETTEXT_MO ?= $(patsubst %.po,%.mo,$(GETTEXT_PO)) GETTEXT_INPUT_DIRS ?= $(wildcard $(TOPDIR)/tools $(TOPDIR)/src $(TOPDIR)/conf) +GETTEXT_INPUT_EXTS ?= php cpp conf GETTEXT_INPUT_FILES ?= $(foreach d,$(GETTEXT_INPUT_DIRS),\ - $(shell find $d -name '*.php' -o -name '*.cpp' -o -name '*.conf')) + $(shell find $d -name translate-me $(foreach ext,$(GETTEXT_INPUT_EXTS),-o -name '*.$(ext)'))) GETTEXT_KEYWORDS ?= htr ehtr $(GETTEXT_EXTRA_KEYWORDS) GETTEXT_LINKS ?= LC_MESSAGES