summaryrefslogtreecommitdiff
path: root/cocoa/compile-xib.sh
diff options
context:
space:
mode:
authorSven Weidauer <sven.weidauer@gmail.com>2011-02-25 21:50:21 +0000
committerSven Weidauer <sven.weidauer@gmail.com>2011-02-25 21:50:21 +0000
commitde74250a3e0917cad8dbd163b854b3e6b4bfbee9 (patch)
tree5fedd55620fbd9089f103503fabda0670a3c365e /cocoa/compile-xib.sh
parentb1a2212a95b9ecc324da1fad679b596286a04bbe (diff)
downloadnetsurf-de74250a3e0917cad8dbd163b854b3e6b4bfbee9.tar.gz
netsurf-de74250a3e0917cad8dbd163b854b3e6b4bfbee9.tar.bz2
Building translated nib files if strings file exist.
svn path=/trunk/netsurf/; revision=11802
Diffstat (limited to 'cocoa/compile-xib.sh')
-rwxr-xr-xcocoa/compile-xib.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/cocoa/compile-xib.sh b/cocoa/compile-xib.sh
new file mode 100755
index 000000000..264d87761
--- /dev/null
+++ b/cocoa/compile-xib.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+# call: compile-xib.sh [xib file] [language] [(optional output nib file)]
+DIR=`dirname "$1"`
+XIB=`basename -s .xib "$1"`
+
+STRINGS_FILE="$DIR/$2.lproj/$XIB.xib.strings"
+TRANSLATE=""
+if [ -f $STRINGS_FILE ]
+then
+ TRANSLATE="--strings-file $STRINGS_FILE"
+fi
+
+OUTPUT="$2.$XIB.nib"
+
+if [ "x$3" != "x" ]
+then
+ OUTPUT="$3"
+fi
+
+exec ibtool $TRANSLATE --compile $OUTPUT $1