#
# Clawsker po Makefile
-# Copyright 2007-2016 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
+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 fr nl pt_BR sv nb de ca tr da id
+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