Files
openttd-android/android-store-strings.sh
2018-05-31 22:09:15 +03:00

14 lines
487 B
Bash
Executable File

#!/bin/sh
for f in ../translations/lang/*.txt; do
[ "$f" = ../translations/lang/english.txt ] && continue
out=src/lang/`basename $f`
grep "^# Android strings" $out > /dev/null || [ -z "`tail -c 2 $out`" ] || echo >> $out
{ grep -v "^# Android strings" $out ; echo "# Android strings" ; } > $out.new
mv -f $out.new $out
cat $f | grep '^STR' | while read name text; do
{ grep -v "^$name\b" $out ; printf "%-64s%s\n" "$name" "$text" ; } > $out.new
mv -f $out.new $out
done
done