2021-12-21 13:15:51 +00:00
|
|
|
#!/bin/bash
|
2018-06-21 16:59:11 +00:00
|
|
|
#
|
|
|
|
# clean.sh - multi-language support script
|
|
|
|
# Remove all language output files from lang folder.
|
|
|
|
#
|
|
|
|
|
2021-12-21 13:15:51 +00:00
|
|
|
# Config:
|
|
|
|
echo "CONFIG: $CONFIG_OK"
|
|
|
|
if [ -z "$CONFIG_OK" ]; then eval "$(cat config.sh)"; fi
|
|
|
|
if [ -z "$CONFIG_OK" ] | [ $CONFIG_OK -eq 0 ]; then echo 'Config NG!' >&2; exit 1; fi
|
|
|
|
|
|
|
|
if [ ! -z "$COMMUNITY_LANGUAGES" ]; then
|
|
|
|
LANGUAGES+=" $COMMUNITY_LANGUAGES"
|
|
|
|
fi
|
|
|
|
|
2018-06-21 16:59:11 +00:00
|
|
|
result=0
|
|
|
|
|
|
|
|
rm_if_exists()
|
|
|
|
{
|
|
|
|
if [ -e $1 ]; then
|
|
|
|
echo -n " removing '$1'..." >&2
|
|
|
|
if rm $1; then
|
|
|
|
echo "OK" >&2
|
|
|
|
else
|
|
|
|
echo "NG!" >&2
|
|
|
|
result=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
clean_lang()
|
|
|
|
{
|
2018-10-25 16:16:36 +00:00
|
|
|
if [ "$1" = "en" ]; then
|
2018-06-21 16:59:11 +00:00
|
|
|
rm_if_exists lang_$1.tmp
|
|
|
|
else
|
2018-10-18 11:08:12 +00:00
|
|
|
rm_if_exists lang_$1.tmp
|
2018-06-21 16:59:11 +00:00
|
|
|
rm_if_exists lang_en_$1.tmp
|
|
|
|
rm_if_exists lang_en_$1.dif
|
|
|
|
rm_if_exists lang_$1.ofs
|
|
|
|
rm_if_exists lang_$1.txt
|
|
|
|
fi
|
2018-10-18 11:08:12 +00:00
|
|
|
rm_if_exists lang_$1_check.dif
|
2018-06-21 16:59:11 +00:00
|
|
|
rm_if_exists lang_$1.bin
|
|
|
|
rm_if_exists lang_$1.dat
|
2018-10-18 11:08:12 +00:00
|
|
|
rm_if_exists lang_$1_1.tmp
|
|
|
|
rm_if_exists lang_$1_2.tmp
|
2018-06-21 16:59:11 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 13:15:51 +00:00
|
|
|
#Clean English
|
|
|
|
clean_lang en
|
2018-06-21 16:59:11 +00:00
|
|
|
|
2021-12-21 13:15:51 +00:00
|
|
|
#Clean languages
|
|
|
|
echo "lang-clean.sh started" >&2
|
|
|
|
echo "lang-clean languages:$LANGUAGES" >&2
|
|
|
|
for lang in $LANGUAGES; do
|
|
|
|
clean_lang $lang
|
|
|
|
done
|
2021-03-01 07:28:08 +00:00
|
|
|
|
2018-06-21 16:59:11 +00:00
|
|
|
echo -n "lang-clean.sh finished" >&2
|
|
|
|
if [ $result -eq 0 ]; then
|
|
|
|
echo " with success" >&2
|
|
|
|
else
|
|
|
|
echo " with errors!" >&2
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "$-" in
|
|
|
|
*i*) echo "press enter key" >&2; read ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit $result
|