summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-07-29 19:53:46 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-07-29 20:04:46 -0400
commitef05dc9c3ba8db00ef8ec43b33311f250c3bbd05 (patch)
tree6cd8195dc418af5600c09d3ac29759fbef2fcfdd
parent14346ff78d1392a117dee14afb0c12bd2ba822fe (diff)
downloadrockbox-ef05dc9c3ba8db00ef8ec43b33311f250c3bbd05.tar.gz
rockbox-ef05dc9c3ba8db00ef8ec43b33311f250c3bbd05.zip
langstats: Use updatelang instead of 'genlang -u'
Change-Id: I30a86bf9035e9e538603d0cc730a0449bf9a17d7
-rwxr-xr-xtools/langstatus33
1 files changed, 21 insertions, 12 deletions
diff --git a/tools/langstatus b/tools/langstatus
index 3c5fd74c63..cde5f3e875 100755
--- a/tools/langstatus
+++ b/tools/langstatus
@@ -2,16 +2,16 @@
2 2
3if [ "wiki" = "$1" ]; then 3if [ "wiki" = "$1" ]; then
4 echo "As of `LC_ALL=C date +'%d %b %Y'`, the current status of the translations is the following:" 4 echo "As of `LC_ALL=C date +'%d %b %Y'`, the current status of the translations is the following:"
5 echo "| *Language* | *Missing strings* | *Changed desc* | *Changed source* |" 5 echo "| *Language* | *Missing strings* | *Changed desc* | *Changed source* | *Missing translation* | *Missing voice* |"
6 FORMAT="|%s| %d| %d| %d|\n" 6 FORMAT="|%s| %d| %d| %d|\n"
7else 7else
8 echo ".----------------------.-----------------.---------------.---------------." 8 echo ".----------------------.-----------------.--------------.----------------.---------------.---------------."
9 echo "| Language | Missing strings | Changed desc | Changed source |" 9 echo "| Language | Missing strings | Changed desc | Changed source | Missing trans | Missing voice |"
10 echo "|----------------------|-----------------|--------------|----------------|" 10 echo "|----------------------|-----------------|--------------|----------------|---------------|---------------|"
11 FORMAT="| %-20s | %15d | %12d | %14d |\n" 11 FORMAT="| %-20s | %15d | %12d | %14d | %13d | %13d |\n"
12fi 12fi
13 13
14GENLANG=`dirname $0`/genlang 14UPDLANG=`dirname $0`/updatelang
15LANGDIR=`dirname $0`/../apps/lang 15LANGDIR=`dirname $0`/../apps/lang
16ENGLISH="$LANGDIR"/english.lang 16ENGLISH="$LANGDIR"/english.lang
17 17
@@ -19,31 +19,40 @@ ENGLISH="$LANGDIR"/english.lang
19 LANGUAGE=`basename $LANGFILE .lang |sed -e "s/^\(.\)/\U\1/"` 19 LANGUAGE=`basename $LANGFILE .lang |sed -e "s/^\(.\)/\U\1/"`
20 20
21 21
22 $GENLANG -u -e=$ENGLISH $LANGFILE |grep "^###" |( 22 $UPDLANG $ENGLISH $LANGFILE - |grep "^###" |(
23 MISSING=0 23 MISSING=0
24 CHANGE_DESC=0 24 CHANGE_DESC=0
25 CHANGE_SRC=0 25 CHANGE_SRC=0
26 MISS_DEST=0
27 MISS_VOICE=0
26 28
27 while read LINE; do 29 while read LINE; do
28 case $LINE in 30 case $LINE in
29 "### This phrase below was not present in the translated file") 31 "### This phrase is missing entirely"*)
30 MISSING=`expr $MISSING + 1` 32 MISSING=`expr $MISSING + 1`
31 ;; 33 ;;
32 "### The 'desc' field differs from the english!") 34 "### The 'desc' field for"*|"### The 'user' field for"*)
33 CHANGE_DESC=`expr $CHANGE_DESC + 1` 35 CHANGE_DESC=`expr $CHANGE_DESC + 1`
34 ;; 36 ;;
35 "### The <source> section differs from the english!") 37 "### The <source> section for"*)
36 CHANGE_SRC=`expr $CHANGE_SRC + 1` 38 CHANGE_SRC=`expr $CHANGE_SRC + 1`
37 ;; 39 ;;
40 "### The <dest> section for"*)
41 MISS_DEST=`expr $MISS_DEST + 1`
42 ;;
43 "### The <voice> section for"*)
44 MISS_VOICE=`expr $MISS_VOICE + 1`
45 ;;
46
38 *) 47 *)
39 #echo $LINE 48 #echo $LINE
40 ;; 49 ;;
41 esac 50 esac
42 done 51 done
43 printf "$FORMAT" "$LANGUAGE" "$MISSING" "$CHANGE_DESC" "$CHANGE_SRC" 52 printf "$FORMAT" "$LANGUAGE" "$MISSING" "$CHANGE_DESC" "$CHANGE_SRC" "$MISS_DEST" "$MISS_VOICE"
44 ) 53 )
45done) 2>/dev/null 54done) 2>/dev/null
46 55
47if [ "wiki" != "$1" ]; then 56if [ "wiki" != "$1" ]; then
48 echo "'----------------------'-----------------'--------------'----------------'" 57 echo "'----------------------'-----------------'--------------'----------------'---------------'----------------'"
49fi 58fi