summaryrefslogtreecommitdiff
path: root/bin/pykolab-update-lang
blob: e6bab887e1b4d30f4e6d5eb3efe3243c02d6949d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

echo "Updating language files"

> po/POTFILES.in
> po/POTFILES.skip

find . -type f -name "*.py" -o -name "*.py.in" | \
    sort | \
    sed -e 's/^.\///g' | \
    while read file; do
        if [ $(git ls-files --error-unmatch "${file}" >/dev/null 2>&1; echo $?) -eq 0 ]; then
            echo "${file}" >> po/POTFILES.in
        else
            echo "${file}" >> po/POTFILES.skip
        fi
    done

cd po/
intltool-update --pot --gettext-package=pykolab
if [ "$1" == "po" ]; then
    for lang_file in `ls -1 *.po`; do
        lang=$(echo ${lang_file} | cut -f1 -d'.')
        intltool-update -d ${lang}
        msginit --no-translator --locale=${lang} --input=pykolab.pot --output=${lang_file}
        msgmerge -U ${lang_file} pykolab.pot
    done
    
fi
cd ..