summaryrefslogtreecommitdiff
path: root/po/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2010-09-26 12:38:38 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 19:19:23 +0100
commitc5c3f6133a0fb62ba9c2c3b839e6ea5774f9c76a (patch)
tree44a6d3a12cd11067aea2a4d43eb9133cc25bad2f /po/Makefile
parent941a47be0ca3061f54a237583092357d1ff80f7c (diff)
downloadvyos-live-build-c5c3f6133a0fb62ba9c2c3b839e6ea5774f9c76a.tar.gz
vyos-live-build-c5c3f6133a0fb62ba9c2c3b839e6ea5774f9c76a.zip
Adding debian version 3.0~a1-1.
Diffstat (limited to 'po/Makefile')
-rw-r--r--po/Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/po/Makefile b/po/Makefile
new file mode 100644
index 000000000..3216d1f9a
--- /dev/null
+++ b/po/Makefile
@@ -0,0 +1,39 @@
+# Makefile to manage gettext files
+
+DOMAIN=live-helper
+ECHO_FUNCTIONS="Echo_message Echo_verbose Echo_warning Echo_debug Echo_error Echo_breakage Echo"
+
+POFILES=$(wildcard *.po)
+MOFILES=$(patsubst %.po,%.mo,$(POFILES))
+LINGUAS=$(basename $(POFILES))
+GETTEXTFILES=$(shell find ../scripts/build ../functions -type f)
+POTFILE=$(DOMAIN).pot
+DESTDIR=/
+XGETTEXT_KEYWORDS=$(shell echo $(ECHO_FUNCTIONS) |sed -e 's,\S\+,-k&,g')
+
+%.mo: %.po
+ msgfmt --statistics -o $@ $<
+
+%.po: $(DOMAIN).pot
+ msgmerge -U $*.po $(DOMAIN).pot
+
+$(DOMAIN).pot: $(GETTEXTFILES)
+ $(shell xgettext $(XGETTEXT_KEYWORDS) -L Shell -o $(DOMAIN).pot $(GETTEXTFILES))
+
+update-po: live-helper.pot
+ -for lang in $(LINGUAS); do\
+ msgmerge -U $$lang.po $(DOMAIN).pot; \
+ done
+
+install: $(MOFILES)
+ -for lang in $(LINGUAS); do\
+ install -d $(DESTDIR)/usr/share/locale/$$lang/LC_MESSAGES/; \
+ install -m 644 $$lang.mo $(DESTDIR)/usr/share/locale/$$lang/LC_MESSAGES/$(DOMAIN).mo; \
+ done
+
+all: update-po $(MOFILES)
+
+clean:
+ - rm *.mo *~
+
+.PHONY: update-po