X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fpo%2Fxlat.sh;h=51c3e88c89c4acc15161aedd5f3b5813ffb2983c;hb=9dc94ff0a716a04cdec4ef2466ed20227b79c114;hp=7f7110ec638209fdd01d8f7783aa74b8a5de157f;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/po/xlat.sh b/cinelerra-5.1/po/xlat.sh index 7f7110ec..51c3e88c 100755 --- a/cinelerra-5.1/po/xlat.sh +++ b/cinelerra-5.1/po/xlat.sh @@ -1,7 +1,50 @@ #!/bin/bash +# this script is used on c++ source to modify the _() +# gettext calls to use msgqual(ctxt,id) instead. +# local context regions are defined by using: +# +# #undef MSGQUAL +# #define MSGQUAL "qual_id" +# ... code with _() ... +# #undef MSGQUAL +# #define MSGQUAL 0 +# -for d in guicast/ cinelerra/ plugins/*; do +cin_dir=`mktemp -d -p /tmp cin_XXXXXX` +trap "rm -rf '$cin_dir'" EXIT +mkdir -p "$cin_dir" + +echo 1>&2 "edit" +for d in guicast cinelerra plugins/*; do + if [ ! -d "$d" ]; then continue; fi + mkdir -p "$cin_dir/$d" + ls -1 "$d"/*.[Ch] "$d"/*.inc 2> /dev/null +done | while read f ; do +#qualifier is reset using #define MSGQUAL "qual_id" +#this changes: +# code C_("xxx") [... code _("yyy")] +#to: +# code D_("qual_id#xxx") [... code D_("qual_id#yyy")] + sed -n "$f" > "$cin_dir/$f" -f - <<<'1,1{x; s/.*/_("/; x} +:n1 s/^\(#define MSGQUAL[ ]\)/\1/; t n4 +:n2 s/\&2 "scan" +cd "$cin_dir" +for d in guicast cinelerra plugins/*; do if [ ! -d "$d" ]; then continue; fi - ls -1 $d/*.[Ch] $d/*.inc 2> /dev/null; -done | xgettext --no-wrap -L C++ -k_ -kN_ -f - -o - + ls -1 $d/*.[Ch] $d/*.inc 2> /dev/null +done | xgettext --no-wrap -L C++ -k_ -kN_ -kD_ -f - -o - + +echo 1>&2 "done"