olaf neophyte and de.po updates, valgrind tweaks, delete green lady, inkscape dpi=96
[goodguy/history.git] / cinelerra-5.1 / po / xlat.sh
index f4c7182dbc6a1abf51d018423bb860558098ecbc..3521ae9f4685a903f3545f5c17959afb9bf2d216 100755 (executable)
@@ -9,31 +9,24 @@
 # #undef MSGQUAL
 # #define MSGQUAL 0
 #
-if [ $# -lt 1 -o ! -d "$1" ]; then
-  echo 1>&2 "usage: $0 /<path>/cinelerra-src [/tmp] > /<path>/cin.po"
-  exit 1
-fi
 
-cin_dir=`basename "$1"`
-tmp_dir=`mktemp -d -p ${2:-/tmp} cin_XXXXXX`
-trap "rm -rf '$tmp_dir'" EXIT
-
-#need a copy of src dir for editing
-echo 1>&2 "copy"
-cp -a "$1" "$tmp_dir/."
-cd "$tmp_dir/$cin_dir"
+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
+for d in guicast cinelerra plugins/*; do
   if [ ! -d "$d" ]; then continue; fi
-  ls -1 $d/*.[Ch] $d/*.inc 2> /dev/null
+  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 -i "$f" -f - <<<'1,1{x; s/.*/_("/; x}
+  bn=${f##*/}; fn=${bn%.*}
+  sed -n "$f" > "$cin_dir/$f" -f - <<<'1,1{x; s/.*/D_("'$fn'#/; x}; t n1
 :n1 s/^\(#define MSGQUAL[      ]\)/\1/; t n4
 :n2 s/\<C_("/\
 /; t n3; P; d; n; b n1
@@ -48,7 +41,8 @@ done
 
 #scan src and generate cin.po
 echo 1>&2 "scan"
-for d in guicast/ cinelerra/ plugins/*; do
+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_ -kD_ -f - -o -