passepartout-apple/scripts/util/list-untranslated.sh

19 lines
547 B
Bash
Raw Normal View History

#!/bin/bash
DIR="Passepartout/App"
2022-09-25 06:44:30 +00:00
FILENAME="Localizable.strings"
LANG_BASE="en"
2022-09-25 06:44:30 +00:00
LANG_TARGET="$1"
STRINGS_BASE="$DIR/$LANG_BASE.lproj/$FILENAME"
STRINGS_TARGET="$DIR/$LANG_TARGET.lproj/$FILENAME"
IDS="string-ids.tmp"
TMPOUT="untranslated.tmp"
sed -E "s/^(.+) = .*$/\1/" $STRINGS_BASE | sort | grep '^"' >$IDS.$LANG_BASE
sed -E "s/^(.+) = .*$/\1/" $STRINGS_TARGET | sort | grep '^"' >$IDS.$LANG_TARGET
diff $IDS.$LANG_BASE $IDS.$LANG_TARGET | grep "^<" | sed -E 's/^< "(.*)"$/\1/g' >$TMPOUT
rm -f $IDS.*
grep -f $TMPOUT $STRINGS_BASE
rm $TMPOUT