From 5a64869a1b267552f0b1f00846069b7f2fb56d16 Mon Sep 17 00:00:00 2001 From: Yuri Chornoivan Date: Sat, 2 Nov 2013 15:55:32 +0200 Subject: Build with translations --- po/Makefile | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 po/Makefile (limited to 'po/Makefile') diff --git a/po/Makefile b/po/Makefile new file mode 100644 index 0000000..ceb9b46 --- /dev/null +++ b/po/Makefile @@ -0,0 +1,50 @@ +LANGUAGES=$(basename $(wildcard *.po)) + +PACKAGE_NAME=net_monitor +DESTDIR=$(RPM_BUILD_ROOT) + +all: gmo + + +clean: + @echo " **CLEAN**" + @rm -rf *.mo *~ tmp/ + @for lang in $(LANGUAGES); do \ + echo " **CLEANDIR** $$lang"; \ + rm -rf $$lang;\ + done + +files: + find ../ -name "*.py" -o -name "net_monitor" > FILES +pot: + xgettext --copyright-holder='Eugeni Dodonov ' --package-name=net_monitor --from-code=UTF-8 \ +-L Python --msgid-bugs-address=http://bugs.mageia.org -o $(PACKAGE_NAME).pot --files-from=FILES + +po: + @for lang in $(LANGUAGES); do \ + echo " Updating po for $$lang"; \ + if [ ! -f $$lang.po ]; then \ + msginit --input $(PACKAGE_NAME).pot -o $$lang-old.po;\ + else \ + mv $$lang.po $$lang-old.po; \ + fi ; \ + msgmerge -o $$lang.po $$lang-old.po $(PACKAGE_NAME).pot; \ + rm -f $$lang-old.po; \ + done + +gmo: + @echo " **COMPILING** languages: $(LANGUAGES)" + @for lang in $(LANGUAGES); do \ + echo " **COMPILEMO** $$lang" ; \ + mkdir -p $$lang/LC_MESSAGES/; \ + msgfmt --verbose -o $$lang/LC_MESSAGES/$(PACKAGE_NAME).mo $$lang.po; \ + done + +install: + @echo " **INSTALL** languages: $(LANGUAGES)" + @for lang in $(LANGUAGES); do \ + echo " **INSTALLMO** $$lang" ; \ + mkdir -p $(DESTDIR)/share/locale/$$lang/LC_MESSAGES/; \ + msgfmt -o $(DESTDIR)/share/locale/$$lang/LC_MESSAGES/$(PACKAGE_NAME).mo -f $$lang.po; \ + done + -- cgit v1.2.1