generate_data.sh 1.09 KB
Newer Older
Cédric Bellegarde's avatar
Cédric Bellegarde committed
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/bash

function generate_resource()
{
    echo '<?xml version="1.0" encoding="UTF-8"?>'
    echo '<gresources>'
    echo '  <gresource prefix="/org/gnome/Eolie">'
    for file in data/*.html data/*.css data/*.js
    do
        echo -n '    <file compressed="true">'
        echo -n $(basename $file)
        echo '</file>'
    done
14
    for file in data/*.ui AboutDialog.ui
Cédric Bellegarde's avatar
Cédric Bellegarde committed
15 16 17 18 19 20 21 22 23
    do
        echo -n '     <file compressed="true" preprocess="xml-stripblanks">'
        echo -n $(basename $file)
        echo '</file>'
    done
    echo '  </gresource>'
    echo '</gresources>'
}

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

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