2011-02-26 00:50:21 +03:00
|
|
|
#!/bin/sh
|
|
|
|
# call: compile-xib.sh [xib file] [language] [(optional output nib file)]
|
2016-02-09 00:19:15 +03:00
|
|
|
DIR=`dirname "$1"`
|
|
|
|
XIB=`basename -s .xib "$1"`
|
2011-02-26 00:50:21 +03:00
|
|
|
|
2016-02-09 00:19:15 +03:00
|
|
|
STRINGS_FILE="$DIR/$2.lproj/$XIB.xib.strings"
|
2011-02-26 00:50:21 +03:00
|
|
|
TRANSLATE=""
|
|
|
|
if [ -f $STRINGS_FILE ]
|
|
|
|
then
|
|
|
|
TRANSLATE="--strings-file $STRINGS_FILE"
|
|
|
|
fi
|
|
|
|
|
2016-02-09 00:19:15 +03:00
|
|
|
OUTPUT="$2.$XIB.nib"
|
2011-02-26 00:50:21 +03:00
|
|
|
|
2016-02-09 00:19:15 +03:00
|
|
|
if [ "x$3" != "x" ]
|
2011-02-26 00:50:21 +03:00
|
|
|
then
|
2016-02-09 00:19:15 +03:00
|
|
|
OUTPUT="$3"
|
2011-02-26 00:50:21 +03:00
|
|
|
fi
|
|
|
|
|
2016-02-09 00:19:15 +03:00
|
|
|
exec /usr/bin/ibtool $TRANSLATE --compile $OUTPUT $1
|