make: add a variable 'DOMAIN' for the name of the pot and mo files

Having the name of the domain hard-coded in many places in the makefiles
makes it harder to maintain them, specially because much code is duplicated
between the makefiles that handle po files.

There is now the variable DOMAIN that is set once in each concerned
makefile, and the rest of the makefile makes use of it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS authored and Carlos R. Mafra committed 2015-01-20 21:29:24 +00:00
1 parent c72f013136
commit bb544439f4
4 files changed
+36 -28

No files matched your search

+9 -7
View File
@@ -1,8 +1,10 @@
DOMAIN = WINGs
nlsdir = $(NLSDIR)
CATALOGS = @WINGSMOFILES@
CLEANFILES = $(CATALOGS) WINGs.pot
CLEANFILES = $(CATALOGS) $(DOMAIN).pot
EXTRA_DIST = bg.po ca.po cs.po de.po fr.po hu.po nl.po sk.po
@@ -77,13 +79,13 @@ SUFFIXES = .po .mo
all-local: $(CATALOGS)
WINGs.pot: $(POTFILES)
xgettext --default-domain=WINGs \
$(DOMAIN).pot: $(POTFILES)
xgettext --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES)
if cmp -s WINGs.po WINGs.pot; then \
rm -f WINGs.po; \
if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
rm -f $(DOMAIN).po; \
else \
mv -f WINGs.po WINGs.pot; \
mv -f $(DOMAIN).po $(DOMAIN).pot; \
fi
install-data-local: $(CATALOGS)
@@ -92,7 +94,7 @@ install-data-local: $(CATALOGS)
if test "$$n" -a "$$n" != "__DuMmY" ; then \
l=`basename $$n .mo`; \
$(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
$(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/WINGs.mo; \
$(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
fi; \
done