|
44 | 44 | exit 1 |
45 | 45 | fi |
46 | 46 |
|
| 47 | +IBSTRINGSDIR=ibstrings |
| 48 | +XIB_BASE="$GIT_DIR/Interfaces/English.lproj" |
| 49 | + |
47 | 50 | echo "Cleaning remains of any previous nightly builds..." |
48 | 51 |
|
49 | 52 | # Delete any previous disk images and translation files |
50 | 53 | rm -f *.dmg &> /dev/null |
51 | 54 | rm -rf disttemp &> /dev/null |
52 | 55 | rm -f languagetranslations.zip &> /dev/null |
53 | 56 | rm -rf languagetranslations &> /dev/null |
| 57 | +rm -rf $IBSTRINGSDIR &> /dev/null |
54 | 58 |
|
55 | | -echo "Downloading localizations to merge in..." |
| 59 | +echo "Creating IB strings files for rekeying..." |
| 60 | +mkdir -p $IBSTRINGSDIR/English.lproj |
| 61 | +find "$XIB_BASE" \( -name "*.xib" \) | while read FILE; do |
| 62 | + printf "\t$(basename ${FILE})\n" |
| 63 | + ibtool "$FILE" --export-strings-file "$IBSTRINGSDIR/English.lproj/`basename "$FILE" .xib`.strings" |
| 64 | +done |
56 | 65 |
|
| 66 | +echo "Downloading localizations to merge in..." |
57 | 67 | # Download the latest language translations, and copy them into the Resources directory |
58 | 68 | curl http://dev.sequelpro.com/translate/download/sequelpro > languagetranslations.zip |
59 | 69 | unzip -q languagetranslations.zip -d languagetranslations |
| 70 | + |
| 71 | +echo "Rekeying localization files, translating xibs, merging localizations..." |
60 | 72 | find languagetranslations/Resources \( -name "*.lproj" \) | while read FILE; do |
61 | | - printf "\tCopying localization: $(basename ${FILE})\n" |
62 | | - cp -R "$FILE" "Sequel Pro.app/Contents/Resources/" |
| 73 | + loc=`basename "$FILE"` |
| 74 | + mkdir "$IBSTRINGSDIR/$loc" |
| 75 | + printf "\tRekeying localization: $loc\n" |
| 76 | + find "$FILE" \( -name "*.strings" \) | while read STRFILE; do |
| 77 | + file=`basename "$STRFILE" .strings` |
| 78 | + printf "\t\tFile: $file\n" |
| 79 | + ibkeyfile="$IBSTRINGSDIR/English.lproj/$file.strings" |
| 80 | + xibfile="$XIB_BASE/$file.xib" |
| 81 | + transfile="$IBSTRINGSDIR/$loc/$file.strings" |
| 82 | + if [ -e "$ibkeyfile" ] && [ -e "$xibfile" ]; then |
| 83 | + $BUILD_DIR/xibLocalizationPostprocessor "$STRFILE" "$ibkeyfile" "$transfile" |
| 84 | + #we no longer need the original file and don't want to copy it |
| 85 | + rm -f "$STRFILE" |
| 86 | + ibtool "$xibfile" --import-strings-file "$transfile" --compile "languagetranslations/Resources/$loc/$file.nib" |
| 87 | + fi |
| 88 | + done |
| 89 | + printf "\tCopying localization: $loc\n" |
| 90 | + cp -R "$FILE" "Sequel Pro.app/Contents/Resources/" |
63 | 91 | done |
64 | 92 |
|
65 | 93 | echo "Copying nightly icon" |
|
0 commit comments