~openerp-dev/openerp-web/trunk-diagram-draw2d-add_label-dhr

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh

usage() {
cat << EOF
usage: $0 -a
usage: $0 DIR OUTPUT_FILE

OPTIONS:
   -a    recreate the .pot file for all addons
   -h    print this message
EOF
exit 0
}

do_all=

while getopts "a" opt
do
    case "$opt" in
    a) 
        do_all=true;;
    h)
        usage;;
    \?)
        usage;;  
  esac
done

shift $((OPTIND-1))

if [ -n "$do_all" ]
then
    echo "Extracting all the translations"
    executable=$0
    extract_module() {
       $executable addons/$1 addons/$1/po/$1.pot 
    }
    extract_module web
    extract_module web_calendar
    extract_module web_dashboard
    extract_module web_diagram
    extract_module web_gantt
    extract_module web_graph
    extract_module web_hello
    extract_module web_chat
    extract_module web_mobile
    extract_module web_rpc
elif [ -n "$2" ]
then
    ./npybabel.py extract -F babel.cfg -o $2 -k _t -k _lt --no-default-keywords $1
else
    usage
fi