summaryrefslogtreecommitdiff
path: root/l10nstat.sh
blob: 7658df422409dd59c67bba069686c53df0865f5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash -x
OOBUILDDIR='/home/timar/libreoffice-3-3/build/libreoffice-3.3.2.1'
MY_PATH=`pwd`
. $OOBUILDDIR/LinuxX86Env.Set.sh
SOURCE_ROOT_DIR='/home/timar/libreoffice-3-3/build/libreoffice-3.3.2.1'
export SOURCE_ROOT_DIR
test -n "$OO_TOOLSDIR" && solenv_dir=$SOLARENV || solenv_dir=$OOBUILDDIR/solenv
if test -f $solenv_dir/inc/postset.mk ; then
    # generate shell variable from completelangiso= from solenv/inc/postset.mk
    # the sed command does the following:
    #	+ if a line ends with a backslash, append the next line to it
    #	+ adds " on the beginning of the value (after =)
    #	+ adds " at the end of the value
    #	+ removes en-US; we want to put it on the beginning
    #	+ prints just the section starting with 'completelangiso=' and ending with the " at the end of line
    eval $(sed -e :a -e '/\\$/N; s/\\\n//; ta' -n -e 's/=/="/;s/\([^\\]\)$/\1"/;s/en-US//;/^completelangiso/p' $solenv_dir/inc/postset.mk)
    for i in $completelangiso; do
        localize -e -l en-US,$i -f $MY_PATH/$i-full.sdf
        grep -v ^nlpsolver $i-full.sdf | grep ^helpcontent2 > $i-help.sdf
        grep -v ^nlpsolver $i-full.sdf | grep -v ^helpcontent2 > $i-ui.sdf
        rm $i-full.sdf
        oo2po -l $i -i $i-help.sdf $i-help
        oo2po -l $i -i $i-ui.sdf $i-ui
        uipercent=`pocount $i-ui | grep -A2 "TOTAL:" | grep "translated" | sed -e "s/^.*[(]//" -e "s/[)].*$//"`
        helppercent=`pocount $i-help | grep -A2 "TOTAL:" | grep "translated" | sed -e "s/^.*[(]//" -e "s/[)].*$//"`
        echo "| $i" >> stat.txt
        echo "| $uipercent" >> stat.txt
        echo "| $helppercent" >> stat.txt
        echo "|-" >> stat.txt
    done
fi