summaryrefslogtreecommitdiff
path: root/language/update.sh
blob: 27a6a1ef8b3d762e573e313aaa5b7cc60cf0b35b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh

if [ "${PWD##*/}" != "language" ]
then
	echo "Please run this script in the language/ subfolder of an anope source tree."
	exit 1
fi

# truncate
: > anope.pot

# find .cpp, .h, and .conf files
# exclude docs and third party modules
# run xgettext on found files
find ../ \
	! -path '../docs/*' \
	-a ! -path '../modules/third/*' \
	-a \( -name '*.cpp' \
		-o -name '*.h' \
		-o -name '*.conf' \
	\) \
	-exec \
		xgettext \
			--escape \
			--language=C++ \
			--sort-output \
			--default-domain=Anope \
			--join-existing \
			--output=anope.pot \
			--from-code=utf-8 \
			--keyword \
			--keyword=_ \
			{} +

for f in *.po
do
	echo "Merging $f"
	msgmerge \
		--no-location \
		--no-wrap \
		--sort-output \
		--update \
		--verbose \
		"${f}" \
		"${f%%.*}.pot"
done

rm -f -- *~