aboutsummaryrefslogtreecommitdiffstats
path: root/po/Makefile
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2023-11-04 17:42:08 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2023-11-04 17:42:08 +0000
commit8d750ce02f00531871737e8afeb2805af6e221a3 (patch)
treed55b69f5beebfed9d5c9ae984c38cfe9a91730a6 /po/Makefile
parent7e85ba6752d0f4adaeba87bd800117eb910e748c (diff)
downloadqarepo-8d750ce02f00531871737e8afeb2805af6e221a3.tar
qarepo-8d750ce02f00531871737e8afeb2805af6e221a3.tar.gz
qarepo-8d750ce02f00531871737e8afeb2805af6e221a3.tar.bz2
qarepo-8d750ce02f00531871737e8afeb2805af6e221a3.tar.xz
qarepo-8d750ce02f00531871737e8afeb2805af6e221a3.zip
Add support for i18n.
Diffstat (limited to 'po/Makefile')
-rw-r--r--po/Makefile32
1 files changed, 32 insertions, 0 deletions
diff --git a/po/Makefile b/po/Makefile
new file mode 100644
index 0000000..d8bc7c9
--- /dev/null
+++ b/po/Makefile
@@ -0,0 +1,32 @@
+NAME = qarepo
+
+localedir = ${prefix}/share/locale
+
+PL_FILE = ../$(NAME)
+DT_FILE = ../$(NAME).desktop.in
+
+POFILES = $(wildcard *.po)
+MOFILES = $(POFILES:%.po=%.mo)
+LANGS = $(POFILES:%.po=%)
+
+all: $(NAME).pot $(POFILES) $(MOFILES)
+
+%.mo: %.po
+ msgfmt -o $@ $<
+
+update: $(NAME).pot
+
+$(NAME).pot: $(PL_FILE) $(DT_FILE)
+ xgettext --language=perl --keyword=__ --output tmp1.pot $(PL_FILE)
+ intltool-update --pot --gettext-package tmp2
+ msgcat --use-first tmp1.pot tmp2.pot > $@
+ @rm -r tmp*.pot
+
+install: all
+ for l in $(LANGS); do \
+ install -d $(localedir)/$$l/LC_MESSAGES; \
+ install -m 644 $$l.mo $(localedir)/$$l/LC_MESSAGES/$(NAME).mo; \
+ done
+
+clean:
+ @rm -rf *.mo $(POFILES:%=%t)