gettext.mk: Create a LC_MESSAGES link to .

A directory with gettext.mk in it, provided it has a locale name, makes the
parent directory to a working localedir, which can be used from within the
janware source tree, so add it with the all target and remove it with clean.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-01-30 09:24:43 +00:00
commit 57e63b2582

View file

@ -14,8 +14,9 @@ GETTEXT_INPUT_DIRS ?= $(wildcard $(TOPDIR)/tools $(TOPDIR)/src $(TOPDIR
GETTEXT_INPUT_FILES ?= $(foreach d,$(GETTEXT_INPUT_DIRS),\
$(shell find $d -name '*.php' -o -name '*.cpp' -o -name '*.conf'))
GETTEXT_KEYWORDS ?= htr ehtr $(GETTEXT_EXTRA_KEYWORDS)
GETTEXT_LINKS ?= LC_MESSAGES
all: $(GETTEXT_MO)
all: $(GETTEXT_MO) | $(GETTEXT_LINKS)
clean: clean-mo
$(RM) -rf *~ .*.swp
install: install_MO
@ -49,6 +50,12 @@ edit: merge $(GETTEXT_PROJECT_POT)
msgfmt --check --verbose --output-file $@.tmp $<
mv $@.tmp $@
LC_%:
ln -s . $@
clean.lc-links:
rm -f $(GETTEXT_LINKS)
clean: clean.lc-links
#msginit --no-translator --locale es_MX --output-file $(PROJECT)_spanish.po --input $(PROJECT).pot
#sed --in-place $(PROJECT)_spanish.po --expression = '/"hello, world!"/,/#: / s/""/"hola mundo"/'
#mkdir --parents ./es_MX.utf8/LC_MESSAGES