2021-01-01 10:13:41 +00:00
|
|
|
#!/bin/sh
|
2021-01-02 22:23:18 +00:00
|
|
|
. .env.$1
|
2021-01-01 10:13:41 +00:00
|
|
|
|
2021-01-02 22:23:18 +00:00
|
|
|
DIR_APP="$APP_ROOT"
|
2021-01-01 10:13:41 +00:00
|
|
|
FILENAME_APP="App.strings"
|
2021-01-02 22:23:18 +00:00
|
|
|
DIR_CORE="Passepartout/Core/Resources"
|
2021-01-01 10:13:41 +00:00
|
|
|
FILENAME_CORE="Core.strings"
|
|
|
|
|
2021-01-02 22:23:18 +00:00
|
|
|
if [[ $3 = "core" ]]; then
|
2021-01-01 10:13:41 +00:00
|
|
|
DIR=$DIR_CORE
|
|
|
|
FILENAME=$FILENAME_CORE
|
|
|
|
else
|
|
|
|
DIR=$DIR_APP
|
|
|
|
FILENAME=$FILENAME_APP
|
|
|
|
fi
|
|
|
|
|
|
|
|
LANG_BASE="en"
|
2021-01-02 22:23:18 +00:00
|
|
|
LANG_TARGET="$2"
|
2021-01-01 10:13:41 +00:00
|
|
|
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
|