mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-28 01:12:30 +01:00
make: new target 'update-lang' to update the PO files for a languages against latest sources
With the new target, it is now easy to update all translations in the project for a language against latest code with the simple command, run from the top directory: make update-lang PO=<lang> Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
2429d5e196
commit
a9a0d2ac85
26
Makefile.am
26
Makefile.am
@@ -40,6 +40,7 @@ EXTRA_DIST = TODO BUGS BUGFORM FAQ INSTALL \
|
||||
email-clients.txt checkpatch.pl update-changelog.pl \
|
||||
script/check-translation-sources.sh \
|
||||
script/generate-mapfile-from-header.sh \
|
||||
script/generate-po-from-template.sh \
|
||||
script/generate-txt-from-texi.sh \
|
||||
script/nested-func-to-macro.sh
|
||||
|
||||
@@ -56,3 +57,28 @@ coverage:
|
||||
|
||||
.PHONY: coverage-reset coverage
|
||||
endif
|
||||
|
||||
# make update-lang PO=<lang>
|
||||
# ==========================
|
||||
# Update the PO files against the POT file in all the translation sub-directories
|
||||
#
|
||||
# We do not use an automatic recursive target from Automake (AM_EXTRA_RECURSIVE_TARGETS)
|
||||
# because we want to check only once that the variable PO was defined; the added bonus
|
||||
# being that we do not process all directories but only the related ones, which is
|
||||
# faster and a lot less verbose
|
||||
|
||||
update-lang:
|
||||
if HAVE_XGETTEXT
|
||||
@if echo "$(PO)" | grep -v '^[a-z][a-z]\(_[A-Z][A-Z]\)\?$$' > /dev/null ; then \
|
||||
echo "Error: invalid value \"$(PO)\" for update-lang, use PO=<lang>" >&2 ; exit 1 ; \
|
||||
fi ; \
|
||||
for subdir in $(SUBDIRS_PO); do \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) update-lang || exit $$?); \
|
||||
done
|
||||
|
||||
SUBDIRS_PO = WINGs/po po util/po WPrefs.app/po
|
||||
else
|
||||
@echo "Error: the program 'xgettext' was not found by configure, it is mandatory for this operation" >&2 ; exit 1
|
||||
endif
|
||||
|
||||
.PHONY: update-lang
|
||||
|
||||
Reference in New Issue
Block a user