summaryrefslogtreecommitdiffstats
path: root/po/Makefile
diff options
context:
space:
mode:
authorDaniel Napora <napcok@gmail.com>2013-11-09 15:11:32 +0100
committerDaniel Napora <napcok@gmail.com>2013-11-09 15:11:32 +0100
commitd1c38f1d76b8dcecc46255393867eca13eb62421 (patch)
tree85718cb82efcade8afd6ea27c882565554a83392 /po/Makefile
parentfceb276dbbeb2fc81fff1006777f2ada32f198b7 (diff)
downloadmageiawelcome-d1c38f1d76b8dcecc46255393867eca13eb62421.tar
mageiawelcome-d1c38f1d76b8dcecc46255393867eca13eb62421.tar.gz
mageiawelcome-d1c38f1d76b8dcecc46255393867eca13eb62421.tar.bz2
mageiawelcome-d1c38f1d76b8dcecc46255393867eca13eb62421.tar.xz
mageiawelcome-d1c38f1d76b8dcecc46255393867eca13eb62421.zip
Initial makefile for .po files
Diffstat (limited to 'po/Makefile')
-rw-r--r--po/Makefile48
1 files changed, 48 insertions, 0 deletions
diff --git a/po/Makefile b/po/Makefile
new file mode 100644
index 0000000..0cc616f
--- /dev/null
+++ b/po/Makefile
@@ -0,0 +1,48 @@
+LANGUAGES=$(basename $(wildcard *.po))
+PACKAGE_NAME=mageiawelcome
+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
+
+
+pot:
+ xgettext --copyright-holder='Daniel Napora <napcok@gmail.com>' --package-name=mageiawelcome --from-code=UTF-8 \
+-L Python --msgid-bugs-address=http://bugs.mageia.org -o $(PACKAGE_NAME).pot ../usr/share/mageiawelcome/mageiawelcome.py
+
+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
+