3 # Copyright 2007-2018 Ricardo Mones <ricardo@mones.org>
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # See COPYING file for license details.
14 TITLE = \# Translatable strings for Clawsker
15 COPYR = \# Copyright (C) 2007 Ricardo Mones <ricardo@mones.org>
16 VERSION ?= $(shell git describe)
18 DATADIR = ${PREFIX}/share
19 LOCALEDIR = ${DATADIR}/locale
21 XG_ARGS = --keyword=_ --flag=_:1:pass-java-format -L Perl -w 80 --package-name=${NAME} --package-version=${VERSION} --msgid-bugs-address=ricardo@mones.org --from-code=UTF-8
22 LINGUAS = es fr nl pt_BR sv nb de ca tr da id zh_TW pt_PT
27 xgettext ${XG_ARGS} -f ./POTFILES -d ${NAME} -o $@
29 # remove bogus entry about_title
30 ${NAME}.pot.1: ${NAME}.pot.0
32 tail -$(shell expr $(shell wc -l < $<) - 22 ) $< >> $@
35 update-pot: ${NAME}.pot.1
36 sed 's,^# SOME DESC.*,${TITLE},;s,^# Copyright.*,${COPYR},' < $< > ${NAME}.pot
40 msgmerge -o $@ --previous $< ${NAME}.pot
43 for po in ${LINGUAS}; \
44 do msgfmt -v --statistics -c -o t-$${po} $${po}.po && mv -f t-$${po} $${po}.mo; \
48 install: all install-dirs
49 for po in ${LINGUAS}; \
50 do install -m 0644 $${po}.mo ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \
54 for po in ${LINGUAS}; \
55 do install -d ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES; \
59 for po in ${LINGUAS}; \
60 do rm -f ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \
72 .PHONY: all build install install-dirs uninstall clean clean-pox clean-build update-pot