2021-02-12 19:15:39 +01:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
if [ ! -d MultiCraft/MultiCraft.xcodeproj ]; then
|
2022-12-02 11:40:55 +01:00
|
|
|
echo "Run this from Apple folder"
|
2021-02-12 19:15:39 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-11-13 17:35:33 +01:00
|
|
|
DEST=$(pwd)/assets/locale
|
2021-02-12 19:15:39 +01:00
|
|
|
|
2022-12-02 11:40:55 +01:00
|
|
|
pushd ../po
|
2021-02-12 19:15:39 +01:00
|
|
|
for lang in *; do
|
|
|
|
[ ${#lang} -ne 2 ] && continue
|
2022-09-01 23:26:24 +02:00
|
|
|
mopath=$DEST/$lang/LC_MESSAGES
|
2021-02-12 19:15:39 +01:00
|
|
|
mkdir -p $mopath
|
|
|
|
pushd $lang
|
|
|
|
for fn in *.po; do
|
|
|
|
# brew install gettext
|
2022-01-03 01:00:14 +01:00
|
|
|
msgfmt -o $mopath/${fn/.po/.mo} $fn
|
2021-02-12 19:15:39 +01:00
|
|
|
done
|
|
|
|
popd
|
|
|
|
done
|
|
|
|
popd
|
|
|
|
|
2022-09-01 23:26:24 +02:00
|
|
|
find $DEST -type d,f -name '.*' -print0 | xargs -0 -- rm -rf
|
2022-05-26 19:31:04 +03:00
|
|
|
|
|
|
|
# remove broken languages
|
|
|
|
for broken_lang in ar he hi ky ms_Arab th; do
|
2022-09-01 23:26:24 +02:00
|
|
|
rm -rf $DEST/$broken_lang
|
2022-05-26 19:31:04 +03:00
|
|
|
done
|