1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#!/usr/bin/env sh
set -ex
mainpot=translations/main.pot
pot=${EXTENSION_UUID}.pot
cp $mainpot ${EXTENSION_UUID}/$pot
for i in translations/*; do
locale_lang=$(echo $i | sed s/'^translations'/'locale'/ | cut -d'.' -f1)
if [ "$locale_lang" != "locale/main" ]; then
mkdir -p ${EXTENSION_UUID}/$locale_lang/LC_MESSAGES
cp -f $i ${EXTENSION_UUID}/$locale_lang/LC_MESSAGES/${EXTENSION_UUID}.po
cd ${EXTENSION_UUID}
po=$locale_lang/LC_MESSAGES/${EXTENSION_UUID}.po
echo $po
msgmerge --backup=off -U $po $pot
msgfmt $po -o ${po%po}mo
cd ..
fi
done
|