From 72d83d576981174677baef3e0a1e8029cbe2f74c Mon Sep 17 00:00:00 2001 From: trifonnt Date: Thu, 24 Sep 2009 08:55:44 +0000 Subject: [PATCH] FR [2865609] - Translation statistics https://sourceforge.net/tracker/?func=detail&aid=2865609&group_id=176962&atid=883808 --- data/translationstats.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 data/translationstats.sh diff --git a/data/translationstats.sh b/data/translationstats.sh new file mode 100755 index 0000000000..caaf65a834 --- /dev/null +++ b/data/translationstats.sh @@ -0,0 +1,34 @@ +#!/bin/bash +if [ $# -lt 1 ]; then + echo "usage: $0 " + echo "you may for example call $0 de_DE/" + exit 1 +fi + +for dir in $@; do + total=0; + translated=0; + echo -n "$dir: " + if [ -d $dir ]; then + cd $dir; + for file in *.xml; do + grep value $file | sed 's:.*<.*original="\(.*\)">\(.*\)<.*:\1 #### \2:' | sed 's:.*<.*original="\(.*\)"/>:\1 #### :' > $file.tmp + while read line; do + orig=${line% ####*} + trans=${line#*#### } + # not even the original has a translation, therefore we do not care + if [ "$orig" == "####" ]; then + continue; + fi + total=$((total + 1)) + # one cannot depend on the trl="Y" attribute, therefore we are checking whether the translation differs from the original + if [ "$orig" != "$trans" ]; then + translated=$((translated+1)) + fi + done < $file.tmp + rm $file.tmp + done + cd .. + echo "$translated strings are translated. The files contain $total strings." + fi +done