summaryrefslogtreecommitdiffstats
path: root/po/Makefile
diff options
context:
space:
mode:
authorDexter Morgan <dmorgan@mageia.org>2011-06-02 20:51:14 +0000
committerDexter Morgan <dmorgan@mageia.org>2011-06-02 20:51:14 +0000
commitbf2d834f5a9074cb2281a0438eb3cf6fe614d44a (patch)
treea5d297c9605c2a84a5cd75671206cf36b7383d8a /po/Makefile
downloaddrakx-kbd-mouse-x11-distro/mga1.tar
drakx-kbd-mouse-x11-distro/mga1.tar.gz
drakx-kbd-mouse-x11-distro/mga1.tar.bz2
drakx-kbd-mouse-x11-distro/mga1.tar.xz
drakx-kbd-mouse-x11-distro/mga1.zip
Branch for updatesdistro/mga1
Diffstat (limited to 'po/Makefile')
-rw-r--r--po/Makefile46
1 files changed, 46 insertions, 0 deletions
diff --git a/po/Makefile b/po/Makefile
new file mode 100644
index 0000000..8776872
--- /dev/null
+++ b/po/Makefile
@@ -0,0 +1,46 @@
+include ../Makefile.config
+
+# Installation directories
+localedir = $(DESTDIR)/usr/share/locale
+
+PGOAL = $(NAME)
+
+# perl files to search translatable strings in
+PL_FILES:= ../tools/* ../lib/*.pm ../lib/*/*.pm
+
+POFILES = $(shell ls *.po)
+MOFILES = $(POFILES:%.po=%.mo)
+POTFILE= $(PGOAL).pot
+LANGS = $(POFILES:%.po=%)
+
+PREFIX = $(RPM_BUILD_ROOT)/usr
+DATADIR = $(PREFIX)/share
+LOCALEDIR=$(DATADIR)/locale
+
+all: $(MOFILES)
+
+install: all
+ for l in $(LANGS); do \
+ install -d $(localedir)/$$l/LC_MESSAGES; \
+ install -m 644 $$l.mo $(localedir)/$$l/LC_MESSAGES/$(PGOAL).mo; \
+ done
+
+clean:
+ rm -f *~ *.[oas] *.mo TAGS
+
+%.mo: %.po
+ msgfmt -o $@ $<
+
+$(POTFILE): $(PL_FILES)
+ perl_checker -q --generate-pot $@ $(PL_FILES)
+
+
+update_n_merge: $(PGOAL).pot merge
+
+merge:
+ @for n in $(POFILES); do \
+ echo "Merging $$n"; \
+ msgmerge -C "$$n" "$$n" $(PGOAL).pot > "$$n"t; \
+ mv -f "$$n"t "$$n"; \
+ done
+