summaryrefslogtreecommitdiff
path: root/i18n
Unidiff
Diffstat (limited to 'i18n') (more/less context) (ignore whitespace changes)
-rwxr-xr-xi18n/status.sh96
1 files changed, 55 insertions, 41 deletions
diff --git a/i18n/status.sh b/i18n/status.sh
index 859c442..9205172 100755
--- a/i18n/status.sh
+++ b/i18n/status.sh
@@ -1,46 +1,60 @@
1#/bin/sh 1#!/bin/sh
2
3#
4# Function:
5# showStringStats <title> <file>
6#
7# Parameters:
8# <title> Title to be displayed.
9# <file> Name of file to be counted.
10#
11function showStringStats ()
12{
13 echo -n "$1: "
14 if [ -e "$2" ]; then
15 csTotal=`grep translation "$2" | wc -l`
16 csUnfinished=`grep translation "$2" | grep type=\"unfinished\" | wc -l`
17 echo ${csUnfinished}", that means `expr ${csUnfinished} \* 100 / ${csTotal}`% needs to be done."
18 else
19 echo "'$2' is missing. No stats available!"
20 fi
21}
22
23#
24# Main
25#
2arg=$1 26arg=$1
3foo=$1 27foo=$1
4if [ x${arg}x = xx ] 28if [ "x${arg}x" = "xx" ]; then
5then 29 arg="."
6 arg=.
7 foo="all" 30 foo="all"
8fi 31fi
9 32
10#general figures 33#
11echo "Status of $foo" 34# General figures
12echo 35#
13 36echo -e "Status of ${foo}:\n"
14echo "number of strings: " 37
15strs=`find $arg -name "*.ts" -exec cat {} \; | grep translation | wc -l` 38echo -n "Number of strings: "
16echo $strs 39strs=`find ${arg} -name "*.ts" -exec grep translation {} \; | wc -l`
17echo "unfinished: " 40echo ${strs}
18unfi=`find $arg -name "*.ts" -exec cat {} \; | grep translation | grep type=\"unfinished\" | wc -l` 41
19echo $unfi", that means" `expr \( $strs - $unfi \) \* 100 / $strs`% "are done" 42echo -n "Unfinished: "
20echo "obsolete: " 43unfi=`find ${arg} -name "*.ts" -exec grep translation {} \; | grep type=\"unfinished\" | wc -l`
21obso=`find $arg -name "*.ts" -exec cat {} \; | grep translation | grep type=\"obsolete\" | wc -l` 44echo ${unfi}", that means `expr \( ${strs} - ${unfi} \) \* 100 / ${strs}`% are done."
22echo $obso `expr $obso \* 100 / $strs`% 45
23 46echo -n "Obsolete: "
24#if [ "foo" = "all" ] 47obso=`find ${arg} -name "*.ts" -exec grep translation {} \; | grep type=\"obsolete\" | wc -l`
25#then 48echo ${obso}" (`expr ${obso} \* 100 / ${strs}`%)"
26 #from here on we will only look at the core-parts. All numbers have to be 0% if 49
27 #the specific language will be in the official release. 50#
28 echo 51# from here on we will only look at the core-parts. All numbers have to be 0% if
29 echo "Core:" 52# the specific language will be in the official release.
30 core_today=`grep translation $arg/today.ts | grep type=\"unfinished\" | wc -l` 53#
31 core_todo=`grep translation $arg/todolist.ts | grep type=\"unfinished\" | wc -l` 54echo -e "\nCore:\n"
32 core_addressbook=`grep translation $arg/addressbook.ts | grep type=\"unfinished\" | wc -l` 55
33 core_datebook=`grep translation $arg/datebook.ts | grep type=\"unfinished\" | wc -l` 56showStringStats "Addressbook" "${arg}/addressbook.ts"
34 libopie=`grep translation $arg/libopie.ts | grep type=\"unfinished\" | wc -l` 57showStringStats "Datebook" "${arg}/datebook.ts"
35 _core_today=`grep translation $arg/today.ts | wc -l` 58showStringStats "libopie" "${arg}/libopie.ts"
36 _core_todo=`grep translation $arg/todolist.ts | wc -l` 59showStringStats "Today" "${arg}/today.ts"
37 _core_addressbook=`grep translation $arg/addressbook.ts | wc -l` 60showStringStats "Todo" "${arg}/todolist.ts"
38 _core_datebook=`grep translation $arg/datebook.ts | wc -l`
39 _libopie=`grep translation $arg/libopie.ts | wc -l`
40#fi
41
42 echo "Today:" $core_today", that means" `expr $core_today \* 100 / $_core_today`% "needs to be done"
43 echo "Datebook:" $core_datebook", that means" `expr $core_datebook \* 100 / $_core_datebook`% "needs to be done"
44 echo "Todo:" $core_todo", that means" `expr $core_todo \* 100 / $_core_todo`% "needs to be done"
45 echo "Addressbook:" $core_addressbook", that means" `expr $core_addressbook \* 100 / $_core_addressbook`% "needs to be done"
46 echo "libopie:" $libopie", that means" `expr $libopie \* 100 / $_libopie`% "needs to be done"