author | mellen <mellen> | 2003-01-16 00:22:26 (UTC) |
---|---|---|
committer | mellen <mellen> | 2003-01-16 00:22:26 (UTC) |
commit | 4e6e6deda15467fe253b546136df00cf5b7ebd02 (patch) (unidiff) | |
tree | bbc514403ab07c03b6a17c2678297643898fba4a /i18n | |
parent | c9286a607b460274a070e10f34863920dae0b9a9 (diff) | |
download | opie-4e6e6deda15467fe253b546136df00cf5b7ebd02.zip opie-4e6e6deda15467fe253b546136df00cf5b7ebd02.tar.gz opie-4e6e6deda15467fe253b546136df00cf5b7ebd02.tar.bz2 |
Cleaned up, optimized and polished.
-rwxr-xr-x | i18n/status.sh | 96 |
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 | # | ||
11 | function 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 | # | ||
2 | arg=$1 | 26 | arg=$1 |
3 | foo=$1 | 27 | foo=$1 |
4 | if [ x${arg}x = xx ] | 28 | if [ "x${arg}x" = "xx" ]; then |
5 | then | 29 | arg="." |
6 | arg=. | ||
7 | foo="all" | 30 | foo="all" |
8 | fi | 31 | fi |
9 | 32 | ||
10 | #general figures | 33 | # |
11 | echo "Status of $foo" | 34 | # General figures |
12 | echo | 35 | # |
13 | 36 | echo -e "Status of ${foo}:\n" | |
14 | echo "number of strings: " | 37 | |
15 | strs=`find $arg -name "*.ts" -exec cat {} \; | grep translation | wc -l` | 38 | echo -n "Number of strings: " |
16 | echo $strs | 39 | strs=`find ${arg} -name "*.ts" -exec grep translation {} \; | wc -l` |
17 | echo "unfinished: " | 40 | echo ${strs} |
18 | unfi=`find $arg -name "*.ts" -exec cat {} \; | grep translation | grep type=\"unfinished\" | wc -l` | 41 | |
19 | echo $unfi", that means" `expr \( $strs - $unfi \) \* 100 / $strs`% "are done" | 42 | echo -n "Unfinished: " |
20 | echo "obsolete: " | 43 | unfi=`find ${arg} -name "*.ts" -exec grep translation {} \; | grep type=\"unfinished\" | wc -l` |
21 | obso=`find $arg -name "*.ts" -exec cat {} \; | grep translation | grep type=\"obsolete\" | wc -l` | 44 | echo ${unfi}", that means `expr \( ${strs} - ${unfi} \) \* 100 / ${strs}`% are done." |
22 | echo $obso `expr $obso \* 100 / $strs`% | 45 | |
23 | 46 | echo -n "Obsolete: " | |
24 | #if [ "foo" = "all" ] | 47 | obso=`find ${arg} -name "*.ts" -exec grep translation {} \; | grep type=\"obsolete\" | wc -l` |
25 | #then | 48 | echo ${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` | 54 | echo -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` | 56 | showStringStats "Addressbook" "${arg}/addressbook.ts" |
34 | libopie=`grep translation $arg/libopie.ts | grep type=\"unfinished\" | wc -l` | 57 | showStringStats "Datebook" "${arg}/datebook.ts" |
35 | _core_today=`grep translation $arg/today.ts | wc -l` | 58 | showStringStats "libopie" "${arg}/libopie.ts" |
36 | _core_todo=`grep translation $arg/todolist.ts | wc -l` | 59 | showStringStats "Today" "${arg}/today.ts" |
37 | _core_addressbook=`grep translation $arg/addressbook.ts | wc -l` | 60 | showStringStats "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" | ||