1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

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
2015-01-20 22:03:54 +01:00
committed by Carlos R. Mafra
parent c72f013136
commit bb544439f4
4 changed files with 36 additions and 28 deletions

View File

@@ -1,8 +1,10 @@
DOMAIN = WINGs
nlsdir = $(NLSDIR) nlsdir = $(NLSDIR)
CATALOGS = @WINGSMOFILES@ 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 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) all-local: $(CATALOGS)
WINGs.pot: $(POTFILES) $(DOMAIN).pot: $(POTFILES)
xgettext --default-domain=WINGs \ xgettext --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES) --add-comments --keyword=_ --keyword=N_ $(POTFILES)
if cmp -s WINGs.po WINGs.pot; then \ if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
rm -f WINGs.po; \ rm -f $(DOMAIN).po; \
else \ else \
mv -f WINGs.po WINGs.pot; \ mv -f $(DOMAIN).po $(DOMAIN).pot; \
fi fi
install-data-local: $(CATALOGS) install-data-local: $(CATALOGS)
@@ -92,7 +94,7 @@ install-data-local: $(CATALOGS)
if test "$$n" -a "$$n" != "__DuMmY" ; then \ if test "$$n" -a "$$n" != "__DuMmY" ; then \
l=`basename $$n .mo`; \ l=`basename $$n .mo`; \
$(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \ $(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; \ fi; \
done done

View File

@@ -1,8 +1,10 @@
DOMAIN = WPrefs
CATALOGS = @WPMOFILES@ CATALOGS = @WPMOFILES@
nlsdir = $(NLSDIR) nlsdir = $(NLSDIR)
CLEANFILES = WPrefs.pot $(CATALOGS) CLEANFILES = $(DOMAIN).pot $(CATALOGS)
EXTRA_DIST = bg.po ca.po cs.po de.po es.po et.po fi.po fr.po hr.po hu.po \ EXTRA_DIST = bg.po ca.po cs.po de.po es.po et.po fi.po fr.po hr.po hu.po \
it.po ja.po ko.po nl.po pt.po ru.po sk.po zh_CN.po zh_TW.po it.po ja.po ko.po nl.po pt.po ru.po sk.po zh_CN.po zh_TW.po
@@ -43,13 +45,13 @@ SUFFIXES = .po .mo
all-local: $(CATALOGS) all-local: $(CATALOGS)
WPrefs.pot: $(POTFILES) $(DOMAIN).pot: $(POTFILES)
xgettext --default-domain=WPrefs \ xgettext --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES) --add-comments --keyword=_ --keyword=N_ $(POTFILES)
if cmp -s WPrefs.po WPrefs.pot; then \ if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
rm -f WPrefs.po; \ rm -f $(DOMAIN).po; \
else \ else \
mv -f WPrefs.po WPrefs.pot; \ mv -f $(DOMAIN).po $(DOMAIN).pot; \
fi fi
@@ -59,7 +61,7 @@ install-data-local: $(CATALOGS)
if test "$$n" -a "$$n" != "__DuMmY" ; then \ if test "$$n" -a "$$n" != "__DuMmY" ; then \
l=`basename $$n .mo`; \ l=`basename $$n .mo`; \
$(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
$(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/WPrefs.mo; \ $(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
fi; \ fi; \
done done

View File

@@ -1,8 +1,10 @@
DOMAIN = WindowMaker
nlsdir = $(NLSDIR) nlsdir = $(NLSDIR)
CATALOGS = @MOFILES@ CATALOGS = @MOFILES@
CLEANFILES = $(CATALOGS) WindowMaker.pot CLEANFILES = $(CATALOGS) $(DOMAIN).pot
# Please keep this sorted in alphabetic order! # Please keep this sorted in alphabetic order!
EXTRA_DIST = be.po bg.po bs.po ca.po cs.po da.po de.po el.po es.po et.po \ EXTRA_DIST = be.po bg.po bs.po ca.po cs.po da.po de.po el.po es.po et.po \
@@ -72,13 +74,13 @@ SUFFIXES = .po .mo
all-local: $(CATALOGS) all-local: $(CATALOGS)
WindowMaker.pot: $(POTFILES) $(DOMAIN).pot: $(POTFILES)
xgettext --default-domain=WindowMaker \ xgettext --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES) --add-comments --keyword=_ --keyword=N_ $(POTFILES)
if cmp -s WindowMaker.po WindowMaker.pot; then \ if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
rm -f WindowMaker.po; \ rm -f $(DOMAIN).po; \
else \ else \
mv -f WindowMaker.po WindowMaker.pot; \ mv -f $(DOMAIN).po $(DOMAIN).pot; \
fi fi
install-data-local: $(CATALOGS) install-data-local: $(CATALOGS)
@@ -87,7 +89,7 @@ install-data-local: $(CATALOGS)
if test "$$n" -a "$$n" != "__DuMmY" ; then \ if test "$$n" -a "$$n" != "__DuMmY" ; then \
l=`basename $$n .mo`; \ l=`basename $$n .mo`; \
$(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
$(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/WindowMaker.mo; \ $(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
fi; \ fi; \
done done

View File

@@ -1,8 +1,10 @@
DOMAIN = wmgenmenu
CATALOGS = @UTILMOFILES@ CATALOGS = @UTILMOFILES@
nlsdir = $(NLSDIR) nlsdir = $(NLSDIR)
CLEANFILES = wmgenmenu.pot $(CATALOGS) CLEANFILES = $(DOMAIN).pot $(CATALOGS)
EXTRA_DIST = de.po es.po fr.po nl.po pt.po EXTRA_DIST = de.po es.po fr.po nl.po pt.po
@@ -18,13 +20,13 @@ SUFFIXES = .po .mo
all-local: $(CATALOGS) all-local: $(CATALOGS)
wmgenmenu.pot: $(POTFILES) $(DOMAIN).pot: $(POTFILES)
xgettext --default-domain=wmgenmenu \ xgettext --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES) --add-comments --keyword=_ --keyword=N_ $(POTFILES)
if cmp -s wmgenmenu.po wmgenmenu.pot; then \ if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
rm -f wmgenmenu.po; \ rm -f $(DOMAIN).po; \
else \ else \
mv -f wmgenmenu.po wmgenmenu.pot; \ mv -f $(DOMAIN).po $(DOMAIN).pot; \
fi fi
@@ -34,6 +36,6 @@ install-data-local: $(CATALOGS)
if test "$$n" -a "$$n" != "__DuMmY" ; then \ if test "$$n" -a "$$n" != "__DuMmY" ; then \
l=`basename $$n .mo`; \ l=`basename $$n .mo`; \
$(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
$(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/wmgenmenu.mo; \ $(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
fi; \ fi; \
done done