Android translation scripts

This commit is contained in:
Sergii Pylypenko
2016-03-28 20:42:43 +03:00
parent 29e1314e97
commit eec71a5e62
3 changed files with 26 additions and 1 deletions

12
android-extract-strings.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
mkdir -p ../translations/lang
git diff 1.6/master -- src/lang/english.txt | tail -n +5 | grep '^+' | cut -b 2- > ../translations/lang/english.txt
for f in src/lang/*.txt; do
[ "$f" = src/lang/english.txt ] && continue
rm -f ../translations/lang/`basename $f`
cat ../translations/lang/english.txt | grep '^STR' | while read name text; do
grep "^$name\b" $f >> ../translations/lang/`basename $f`
done
done

13
android-store-strings.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/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

View File

@@ -468,6 +468,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Message history
############ range for about menu starts
STR_ABOUT_MENU_LAND_BLOCK_INFO :Land area information
STR_ABOUT_MENU_SEPARATOR :
STR_ABOUT_MENU_TUTORIAL :{BLACK}Tutorial
STR_ABOUT_MENU_TOGGLE_CONSOLE :Toggle console
STR_ABOUT_MENU_AI_DEBUG :AI/Game script debug
@@ -479,7 +480,6 @@ STR_ABOUT_MENU_ABOUT_OPENTTD :About 'OpenTTD'
STR_ABOUT_MENU_SPRITE_ALIGNER :Sprite aligner
STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES :Toggle bounding boxes
STR_ABOUT_MENU_TOGGLE_DIRTY_BLOCKS :Toggle colouring of dirty blocks
STR_ABOUT_MENU_SEPARATOR :
############ range ends here
############ range for ordinal numbers used for the place in the highscore window