xml2po: only write translators.xml if existing

usb
Georg Lukas 2014-12-26 14:03:19 +01:00
rodzic cbfeb848eb
commit c578a5c75a
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -8,6 +8,7 @@ RES=res/values
POT=$TRAN/$PACKAGE.pot
PODIR=translations/$PACKAGE
PO=$PODIR/$PACKAGE-
CREDITS=res/values/translators.xml
download() {
FN=launchpad-$(date +%F).tar.gz
@ -44,7 +45,7 @@ translate_po2xml() {
xml2po -a -l $lang -p $po $RES/strings.xml | sed "s/'/\\\\'/g" > $dir/strings.xml
done
sed -i 's/\\\\'\''/\\'\''/g' res/values-*/strings.xml
{
[ -f $CREDITS ] && {
cat <<EOF
<?xml version="1.0" encoding="utf-8"?>
<!-- AUTOGENERATED BY xml2po.sh! DO NOT CHANGE MANUALLY! -->
@ -55,7 +56,7 @@ $(cat translations/$PACKAGE/$PACKAGE-*.po | awk -F ': | <' '/Last-Translator:/ {
</string>
</resources>
EOF
} > res/values/translators.xml
} > $CREDITS
}