30 lines
562 B
Bash
Executable File
30 lines
562 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
if [ ! -d MultiCraft/MultiCraft.xcodeproj ]; then
|
|
echo "Run this from Apple folder"
|
|
exit 1
|
|
fi
|
|
|
|
DEST=$(pwd)/assets/locale
|
|
|
|
pushd ../po
|
|
for lang in *; do
|
|
[ ${#lang} -ne 2 ] && continue
|
|
mopath=$DEST/$lang/LC_MESSAGES
|
|
mkdir -p $mopath
|
|
pushd $lang
|
|
for fn in *.po; do
|
|
# brew install gettext
|
|
msgfmt -o $mopath/${fn/.po/.mo} $fn
|
|
done
|
|
popd
|
|
done
|
|
popd
|
|
|
|
find $DEST -type d,f -name '.*' -print0 | xargs -0 -- rm -rf
|
|
|
|
# remove broken languages
|
|
for broken_lang in dv eo he hi kn ko ms_Arab nn pt_BR sr_* th zh_*; do
|
|
rm -rf $DEST/$broken_lang
|
|
done
|