# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
-
+set -B
+
POTFILE="$1"
DOMAIN="$2"
COPYRIGHT="Robert Kooima"
BUGADDR="robert.kooima@gmail.com"
+DATA=data
+SETS="$DATA"/sets.txt
+COURSES="$DATA"/courses.txt
+
export LC_ALL=C
# First, extract from source
# Second, extract from neverball sets and neverputt courses
echo "# Sets and courses"
-for i in $(< data/sets.txt); do
- i=${i/#/data/}
+for i in $(< "$SETS"); do
+ i="$DATA"/"$i"
# Only translate the two first lines
head -2 $i | while read -r d; do
echo
echo "#: $i"
- # Convert \ to \\
+ # Convert \ to \\
echo "msgid \"${d//\\/\\\\}\""
echo "msgstr \"\""
done >> $POTFILE
done
# the "echo | cat x -" forces the end of the last line
-echo | cat data/courses.txt - | while read -r d; do
+echo | cat "$COURSES" - | while read -r d; do
# Heuristic: description is non empty line without .txt inside
if test -n "$d" && echo "$d" | grep -v ".txt" &> /dev/null; then
echo
- echo "#: $i"
- # Convert \ to \\
+ echo "#: $COURSES"
+ # Convert \ to \\
echo "msgid \"${d//\\/\\\\}\""
echo "msgstr \"\""
fi
# Third, extracts from levels
echo -n "# Levels: "
-find data -name "*.map" | sort | tee .map_list | wc -l
+find "$DATA" -name "*.map" | sort | tee .map_list | wc -l
for i in `cat .map_list`; do
# Check encoding?
# file --mime $i
echo "# Removing duplicates."
msguniq -o "$POTFILE" -t UTF-8 "$POTFILE"
-# vim:noet:sts=8: