Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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 \
mv $new_trans $orig_trans
echo ""
rm $orig_base
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment