HesabixChatPlugin/bin/compile-translations.sh
Babak Alizadeh b9d24256f0 some progress
2026-04-27 16:00:02 +03:30

15 lines
381 B
Shell
Executable file

#!/bin/sh
# تولید فایل .mo از .po — ابتدا msgfmt، در نبود آن اسکریپت Python
set -e
cd "$(dirname "$0")/.."
PY="$PWD/bin/po2mo.py"
for po in languages/*.po; do
[ -e "$po" ] || continue
mo="${po%.po}.mo"
if command -v msgfmt >/dev/null 2>&1; then
msgfmt -o "$mo" "$po"
else
python3 "$PY" "$po" "$mo"
fi
echo "Compiled: $mo"
done