generate_data.sh 1.1 KB
Newer Older
1
    #!/bin/bash
Cédric Bellegarde's avatar
Cédric Bellegarde committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

function generate_resource()
{
    echo '<?xml version="1.0" encoding="UTF-8"?>'
    echo '<gresources>'
    echo '  <gresource prefix="/org/gnome/Lollypop">'
    for file in data/*.css
    do
        echo -n '    <file compressed="true">'
        echo -n $(basename $file)
        echo '</file>'
    done
    for file in data/*.ui AboutDialog.ui
    do
        echo -n '     <file compressed="true" preprocess="xml-stripblanks">'
        echo -n $(basename $file)
        echo '</file>'
    done
    echo '  </gresource>'
    echo '</gresources>'
}

24 25 26 27
function generate_po()
{
    cd po
    git pull https://hosted.weblate.org/git/gnumdk/lollypop
28 29
    >lollypop.pot
    for file in ../data/org.gnome.Lollypop.gschema.xml ../data/*.in ../data/*.ui ../lollypop/*.py
30
    do
31
        xgettext --from-code=UTF-8 -j $file -o lollypop.pot
32
    done
Cédric Bellegarde's avatar
Cédric Bellegarde committed
33 34
    >LINGUAS
    for po in *.po
35
    do
Cédric Bellegarde's avatar
Cédric Bellegarde committed
36 37 38 39
        msgmerge -N $po lollypop.pot > /tmp/$$language_new.po
        mv /tmp/$$language_new.po $po
        language=${po%.po}
        echo $language >>LINGUAS
Cédric Bellegarde's avatar
Cédric Bellegarde committed
40
    done
41 42
}

Cédric Bellegarde's avatar
Cédric Bellegarde committed
43
generate_resource > data/lollypop.gresource.xml
44
generate_po