joinpeertube/zanata/scripts/yml2po.sh

17 lines
607 B
Bash
Raw Normal View History

2018-09-21 21:00:42 +00:00
#!/bin/bash
cp app/locales/*.yml zanata/yml/
2018-09-25 11:35:45 +00:00
yaml2po -P --progress=none -i zanata/yml/en.yml -o zanata/po/${PWD##*/}.pot --duplicates merge
2018-09-21 21:00:42 +00:00
for i in app/locales/*.yml
do
j=$(echo $i | cut -d '.' -f 1 | cut -d '/' -f 3)
yaml2po --progress=none -t zanata/yml/en.yml -i zanata/yml/$j.yml -o zanata/po/$j.po
# Rename empty (almost) .po
tail -n +2 zanata/po/$j.po > zanata/po/tmp.1
tail -n +2 zanata/po/${PWD##*/}.pot > zanata/po/tmp.2
if((`stat -c%s "zanata/po/tmp.1"` <= `stat -c%s "zanata/po/tmp.2"`));then
mv zanata/po/$j.po zanata/po/$j.err
fi
rm zanata/po/tmp.1 zanata/po/tmp.2
done