1
0
2023-08-16 14:04:26 +03:00

30 lines
559 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_* zh_*; do
rm -rf $DEST/$broken_lang
done