1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-24 15:12:32 +01:00
Files
wmaker/util/po/Makefile.am
Christophe CURIS a9a0d2ac85 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>
2015-01-20 21:29:24 +00:00

56 lines
1.3 KiB
Makefile

DOMAIN = wmgenmenu
CATALOGS = @UTILMOFILES@
CLEANFILES = $(DOMAIN).pot $(CATALOGS)
EXTRA_DIST = de.po es.po fr.po nl.po pt.po
POTFILES = \
$(top_srcdir)/util/wmgenmenu.c \
$(top_srcdir)/util/wmgenmenu.h
SUFFIXES = .po .mo
.po.mo:
$(AM_V_GEN)$(MSGFMT) -c -o $@ $<
all-local: $(CATALOGS)
.PHONY: update-lang
if HAVE_XGETTEXT
update-lang: $(DOMAIN).pot
$(AM_V_GEN)$(top_srcdir)/script/generate-po-from-template.sh \
-n "$(PACKAGE_NAME)" -v "$(PACKAGE_VERSION)" -b "$(PACKAGE_BUGREPORT)" \
-t "$(DOMAIN).pot" "$(srcdir)/$(PO).po"
$(DOMAIN).pot: $(POTFILES)
$(AM_V_GEN)$(XGETTEXT) --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES)
@if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
rm -f $(DOMAIN).po; \
else \
mv -f $(DOMAIN).po $(DOMAIN).pot; \
fi
endif
install-data-local: $(CATALOGS)
$(mkinstalldirs) $(DESTDIR)$(localedir)
for n in $(CATALOGS) __DuMmY ; do \
if test "$$n" -a "$$n" != "__DuMmY" ; then \
l=`basename $$n .mo`; \
$(mkinstalldirs) $(DESTDIR)$(localedir)/$$l/LC_MESSAGES; \
$(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(localedir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
fi; \
done
uninstall-local:
for n in $(CATALOGS) ; do \
l=`basename $$n .mo`; \
rm -f $(DESTDIR)$(localedir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
done