Also install Traditional Chinese translation
[clawsker.git] / po / Makefile
index b890453d98cc81bf048082ff58dd308c875e24d1..bb70ff2cc31d3344976044b944d27162917202c4 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Clawsker po Makefile
-# Copyright 2007-2015 Ricardo Mones <ricardo@mones.org>
+# Copyright 2007-2018 Ricardo Mones <ricardo@mones.org>
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 #
 
 NAME = clawsker
-VERSION = $(shell cat ../VERSION)
+TITLE = \# Translatable strings for Clawsker
+COPYR = \# Copyright (C) 2007 Ricardo Mones <ricardo@mones.org>
+VERSION ?= $(shell git describe)
 PREFIX ?= /usr/local
 DATADIR = ${PREFIX}/share
 LOCALEDIR = ${DATADIR}/locale
 
 XG_ARGS = --keyword=_ --flag=_:1:pass-java-format -L Perl -w 80 --package-name=${NAME} --package-version=${VERSION} --msgid-bugs-address=ricardo@mones.org
-LINGUAS = es sr sr@latin fr it id nl pt_BR sv nb
+LINGUAS = es fr nl pt_BR sv nb de ca tr da id zh_TW
 
 all: build
 
 ${NAME}.pot.0:
-       xgettext ${XG_ARGS} -f ./POTFILES -d ${NAME} -o ./${NAME}.pot.0
+       xgettext ${XG_ARGS} -f ./POTFILES -d ${NAME} -o $@
 
 # remove bogus entry win_title
-update-pot: ${NAME}.pot.0
-       head -17 ./${NAME}.pot.0 > ./${NAME}.pot
-       tail -$(shell expr $(shell wc -l < ./${NAME}.pot.0) - 22 ) ./${NAME}.pot.0 >> ./${NAME}.pot
-       rm -f ./${NAME}.pot.0
+${NAME}.pot.1: ${NAME}.pot.0
+       head -17 $< > $@
+       tail -$(shell expr $(shell wc -l < $<) - 22 ) $< >> $@
+       rm -f $<
+
+update-pot: ${NAME}.pot.1
+       sed 's,^# SOME DESC.*,${TITLE},;s,^# Copyright.*,${COPYR},' < $< > ${NAME}.pot
+       rm -f $<
 
 %.pox: %.po
        msgmerge -o $@ --previous $< ${NAME}.pot