-
Notifications
You must be signed in to change notification settings - Fork 219
/
update-pot.sh
executable file
·29 lines (23 loc) · 1.04 KB
/
update-pot.sh
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
#!/bin/sh
# This file should be run from the repository root (e.g. ~/openspades)
# TODO: Optimize and error-checking
FILES_H=`find . -iname *.h`
FILES_CPP=`find . -iname *.cpp`
FILES_C=`find . -iname *.c`
FILES_AS=`find . -iname *.as`
FILES="${FILES_H} ${FILES_CPP} ${FILES_C} ${FILES_AS}"
echo $FILES| tr " " "\n" > .translate.this # Convert spaces to newlines
OPTIONS_OUTPUT="-o Resources/Locales/pot/openspades.pot"
OPTIONS_CPP="--c++"
OPTIONS_KEYWORD="-k_Tr:2,1c -k_TrN:2,1c,3" # Have no idea how this works
OPTIONS_COMMENTS="-c!" # comments for translators
OPTIONS="-j ${OPTIONS_OUTPUT} ${OPTIONS_CPP} ${OPTIONS_KEYWORD} ${OPTIONS_COMMENTS}"
META_PKG="--package-name=OpenSpades"
META_COPYRIGHT="--copyright-holder=yvt"
META_BUGS="[email protected]"
METADATA="$META_PKG $META_COPYRIGHT $META_BUGS --omit-header"
xgettext $OPTIONS $METADATA -f .translate.this
echo "Gettext template file is now up-to-date."
echo
echo "Now you can run 'crowdin upload sources' to upload it to Crowdin!"
echo "(provided that you have an API key to do that)"