summaryrefslogtreecommitdiff
path: root/po/Makefile
diff options
context:
space:
mode:
authorTiago Bortoletto Vaz <tiagovaz@safernet.org.br>2008-08-10 17:39:06 +0200
committerDaniel Baumann <daniel@debian.org>2008-08-10 17:39:06 +0200
commit4f77a42dcf2fd888e3b9dfde16fcee87455ca53d (patch)
tree159713d9ef95a45ff6cd401a95902437aad309cf /po/Makefile
parent016ecd409ea9bab563d267b941e152bd81242877 (diff)
downloadvyos-live-build-4f77a42dcf2fd888e3b9dfde16fcee87455ca53d.tar.gz
vyos-live-build-4f77a42dcf2fd888e3b9dfde16fcee87455ca53d.zip
Adding the basic infrastructure to provide l10n support for live-helper.
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..dd8e46e9c
--- /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"
+
+POFILES=$(wildcard *.po)
+MOFILES=$(patsubst %.po,%.mo,$(POFILES))
+LINGUAS=$(basename $(POFILES))
+GETTEXTFILES=$(shell find ../helpers -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:
+ -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