Created
April 25, 2014 12:52
-
-
Save nickdowell/11288603 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit | |
set -o pipefail | |
langs=(de es fr pt) | |
for path in en.lproj/*.xib; do | |
git diff --quiet $path && git diff --cached --quiet $path || { | |
echo -n "updating localizations for $path" | |
orig_base="$(mktemp -t $0).xib" | |
git show HEAD:Resources/Localisation/$path > $orig_base | |
for lang in "${langs[@]}"; do | |
orig_trans=$PWD/$lang.lproj/$(basename $path) | |
echo -n "." | |
new_trans="$(mktemp -t $0).xib" | |
xcrun ibtool \ | |
--previous-file $orig_base \ | |
--incremental-file $orig_trans \ | |
--localize-incremental \ | |
--write $new_trans \ | |
$PWD/$path | |
mv $new_trans $orig_trans | |
done | |
echo "" | |
rm $orig_base | |
} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment