version update, bld tweaks, resize track booby, 10fps for images
[goodguy/cinelerra.git] / cinelerra-5.1 / po / xlat.sh
1 #!/bin/bash
2 # this script is used on c++ source to modify the _()
3 #  gettext calls to use msgqual(ctxt,id) instead.
4 # local context regions are defined by using:
5 #
6 # #undef MSGQUAL
7 # #define MSGQUAL "qual_id"
8 # ... code with _() ...
9 # #undef MSGQUAL
10 # #define MSGQUAL 0
11 #
12
13 cin_dir=`mktemp -d -p /tmp cin_XXXXXX`
14 trap "rm -rf '$cin_dir'" EXIT
15 mkdir -p "$cin_dir"
16
17 echo 1>&2 "edit"
18 for d in guicast cinelerra plugins/*; do
19   if [ ! -d "$d" ]; then continue; fi
20   mkdir -p "$cin_dir/$d"
21   ls -1 "$d"/*.[Ch] "$d"/*.inc 2> /dev/null
22 done | while read f ; do
23 #qualifier is reset using #define MSGQUAL "qual_id"
24 #this changes:
25 #   code C_("xxx") [... code _("yyy")]
26 #to:
27 #   code D_("qual_id#xxx") [... code D_("qual_id#yyy")]
28   bn=${f##*/}; fn=${bn%.*}
29   sed -n "$f" > "$cin_dir/$f" -f - <<<'1,1{x; s/.*/D_("'$fn'#/; x}; t n1
30 :n1 s/^\(#define MSGQUAL[       ]\)/\1/; t n4
31 :n2 s/\<C_("/\
32 /; t n3; P; d; n; b n1
33 :n3 G; s/^\(.*\)\
34 \(.*\)\
35 \(.*\)$/\1\3\2/; b n2
36 :n4 p; s/^#define MSGQUAL[       ]*"\(.*\)"$/D_("\1#/; t n5
37 s/^.*$/_("/; h; d; n; b n1
38 :n5 h; d; n; b n1
39 '
40 done
41
42 #scan src and generate cin.po
43 echo 1>&2 "scan"
44 cd "$cin_dir"
45 for d in guicast cinelerra plugins/*; do
46   if [ ! -d "$d" ]; then continue; fi
47   ls -1 $d/*.[Ch] $d/*.inc 2> /dev/null
48 done | xgettext --no-wrap -L C++ -k_ -kN_ -kD_ -f - -o -
49
50 echo 1>&2 "done"
51