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
|
2024-06-02 04:35:48 -04:00
|
|
|
broken_langs=(fil gd gl dv eo he hi jbo kn ko kk ky ms_Arab nn pt_BR sr_Cyrl sr_Latn zh_CN zh_TW)
|
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
|
2024-06-02 04:35:48 -04:00
|
|
|
# Skip broken languages
|
|
|
|
if [[ " ${broken_langs[@]} " =~ " ${lang} " ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
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
|
|
|
|
|
2024-06-02 04:35:48 -04:00
|
|
|
# Remove hidden files and directories
|
2022-09-01 23:26:24 +02:00
|
|
|
find $DEST -type d,f -name '.*' -print0 | xargs -0 -- rm -rf
|