summaryrefslogtreecommitdiffstats
path: root/updatepo/update_translation_lines
blob: 8c3c0e12d1a6156f5b64032c0921731ab98546dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

if [[ $1 == "" ]]; then
	THISSCRIPT=$(readlink -f $0)

	if [[ ! -e "$THISSCRIPT" ]]; then
		echo "Unable to find myself!  Exiting..."
		exit 1
	fi

	find . -type f -iname "*.po" -exec $THISSCRIPT {} \;
	exit 0
else
	# Originally from Stack Overflow
	# http://stackoverflow.com/a/7497395
	# Tweaked by Timothy Pearson <kb9vqf@pearsoncomputing.net> for TDE
	echo '' > messages.po # xgettext needs that file, and we need it empty
	find . -type f -iname "*.cpp" -o -type f -iname "*.cc" | xgettext --keyword=i18n --keyword=i18nM --keyword=i18nP:1,2 -j -f -
	msgmerge -N $1 messages.po > new.po
	mv new.po $1
	rm messages.po
fi