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:
7 # #define MSGQUAL "qual_id"
8 # ... code with _() ...
13 cin_dir=`mktemp -d -p /tmp cin_XXXXXX`
14 trap "rm -rf '$cin_dir'" EXIT
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"
25 # code C_("xxx") [... code _("yyy")]
27 # code D_("qual_id#xxx") [... code D_("qual_id#yyy")]
28 sed -n "$f" > "$cin_dir/$f" -f - <<<'1,1{x; s/.*/_("/; x}
29 :n1 s/^\(#define MSGQUAL[ ]\)/\1/; t n4
31 /; t n3; P; d; n; b n1
35 :n4 p; s/^#define MSGQUAL[ ]*"\(.*\)"$/D_("\1#/; t n5
36 s/^.*$/_("/; h; d; n; b n1
41 #scan src and generate cin.po
44 for d in guicast cinelerra plugins/*; do
45 if [ ! -d "$d" ]; then continue; fi
46 ls -1 $d/*.[Ch] $d/*.inc 2> /dev/null
47 done | xgettext --no-wrap -L C++ -k_ -kN_ -kD_ -f - -o -