aboutsummaryrefslogtreecommitdiffstats
path: root/Scripts
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2015-05-29 22:31:51 +0100
committerrowanbeentje <rowan@beent.je>2015-05-29 22:34:05 +0100
commit15800a8df87013aa11754ad4dd414b1f5eae220b (patch)
tree3ede575836558181335f1c67465d7ed9129dc49e /Scripts
parent72cac14c3195dbd92ffab363e9cd98e032233927 (diff)
downloadsequelpro-15800a8df87013aa11754ad4dd414b1f5eae220b.tar.gz
sequelpro-15800a8df87013aa11754ad4dd414b1f5eae220b.tar.bz2
sequelpro-15800a8df87013aa11754ad4dd414b1f5eae220b.zip
Update distribution build process to use the new process written by Max for the nightly buildsrelease-1.1-rc1
Diffstat (limited to 'Scripts')
-rwxr-xr-xScripts/build.sh38
1 files changed, 37 insertions, 1 deletions
diff --git a/Scripts/build.sh b/Scripts/build.sh
index 24343ee9..5348152a 100755
--- a/Scripts/build.sh
+++ b/Scripts/build.sh
@@ -149,7 +149,43 @@ then
if [ -e "${SRCROOT}/ResourcesToCopy" ]
then
- find "${SRCROOT}/ResourcesToCopy" \( -name "*.lproj" \) | while read FILE; do; printf "\tCopying localization: ${FILE}\n"; cp -R "$FILE" "${BUILD_PRODUCT}/Contents/Resources/"; done;
+ TRANSLATIONS_BASE="${SRCROOT}/languagetranslations"
+ IBSTRINGSDIR="${SRCROOT}/ibstrings"
+ XIB_BASE="${SRCROOT}/Interfaces/English.lproj"
+ rm -rf "${IBSTRINGSDIR}" &> /dev/null
+ rm -rf "${TRANSLATIONS_BASE}" &> /dev/null
+
+ echo "Creating IB strings files for rekeying..."
+ cp -R "${SRCROOT}/ResourcesToCopy" "${TRANSLATIONS_BASE}"
+ mkdir -p "$IBSTRINGSDIR/English.lproj"
+ find "${XIB_BASE}" \( -name "*.xib" \) | while read FILE; do
+ ibtool "$FILE" --export-strings-file "$IBSTRINGSDIR/English.lproj/`basename "$FILE" .xib`.strings"
+ done
+
+ echo "Rekeying localization files, translating xibs, merging localizations..."
+ find "${TRANSLATIONS_BASE}" \( -name "*.lproj" \) | while read FILE; do
+ loc=`basename "$FILE"`
+ mkdir "$IBSTRINGSDIR/$loc"
+ printf "\tProcessing: $loc\n"
+ find "$FILE" \( -name "*.strings" \) | while read STRFILE; do
+ file=`basename "$STRFILE" .strings`
+ ibkeyfile="$IBSTRINGSDIR/English.lproj/$file.strings"
+ xibfile="$XIB_BASE/$file.xib"
+ transfile="$IBSTRINGSDIR/$loc/$file.strings"
+ if [ -e "$ibkeyfile" ] && [ -e "$xibfile" ]; then
+ "${BUILT_PRODUCTS_DIR}/xibLocalizationPostprocessor" "$STRFILE" "$ibkeyfile" "$transfile"
+
+ # we no longer need the original file and don't want to copy it
+ rm -f "$STRFILE"
+
+ ibtool "$xibfile" --import-strings-file "$transfile" --compile "${TRANSLATIONS_BASE}/$loc/$file.nib"
+ fi
+ done
+ cp -R "$FILE" "${BUILD_PRODUCT}/Contents/Resources/"
+ done
+
+ rm -rf "${IBSTRINGSDIR}" &> /dev/null
+ rm -rf "${TRANSLATIONS_BASE}" &> /dev/null
else
echo 'No localizations to copy.'
fi