summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Häggqvist <rasher@rasher.dk>2008-12-13 20:50:48 +0000
committerJonas Häggqvist <rasher@rasher.dk>2008-12-13 20:50:48 +0000
commitcc67ba6350eafce4088eaa8be4f4389ee60c2a1f (patch)
tree4bcfab861d4ae52e81470692c55ce9c8fcc24eed
parent9b3d46aeeba962331f1f9cc1895f19cb252ae8e3 (diff)
downloadrockbox-cc67ba6350eafce4088eaa8be4f4389ee60c2a1f.tar.gz
rockbox-cc67ba6350eafce4088eaa8be4f4389ee60c2a1f.tar.bz2
rockbox-cc67ba6350eafce4088eaa8be4f4389ee60c2a1f.zip
Add a small script to show the status of translations.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19431 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-xtools/langstatus49
1 files changed, 49 insertions, 0 deletions
diff --git a/tools/langstatus b/tools/langstatus
new file mode 100755
index 0000000000..79ea0c643f
--- /dev/null
+++ b/tools/langstatus
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+if [ "wiki" == "$1" ]; then
+ echo "As of `LC_ALL=C date +'%d %b %Y'`, the current status of the translations is the following:"
+ echo "| *Language* | *Missing strings* | *Changed desc* | *Changed source* |"
+ FORMAT="|%s| %d| %d| %d|\n"
+else
+ echo ".----------------------.-----------------.---------------.---------------."
+ echo "| Language | Missing strings | Changed desc | Changed source |"
+ echo "|----------------------|-----------------|--------------|----------------|"
+ FORMAT="| %-20s | %15d | %12d | %14d |\n"
+fi
+
+GENLANG=`dirname $0`/genlang
+LANGDIR=`dirname $0`/../apps/lang
+ENGLISH="$LANGDIR"/english.lang
+
+(for LANGFILE in $LANGDIR/*.lang; do
+ LANGUAGE=`basename $LANGFILE .lang |sed -e "s/^\(.\)/\U\1/"`
+
+
+ $GENLANG -u -e=$ENGLISH $LANGFILE |grep "^###" |(
+ MISSING=0
+ CHANGE_DESC=0
+ CHANGE_SRC=0
+
+ while read LINE; do
+ case $LINE in
+ "### This phrase below was not present in the translated file")
+ MISSING=`expr $MISSING + 1`
+ ;;
+ "### The 'desc' field differs from the english!")
+ CHANGE_DESC=`expr $CHANGE_DESC + 1`
+ ;;
+ "### The <source> section differs from the english!")
+ CHANGE_SRC=`expr $CHANGE_SRC + 1`
+ ;;
+ *)
+ #echo $LINE
+ ;;
+ esac
+ done
+ printf "$FORMAT" "$LANGUAGE" "$MISSING" "$CHANGE_DESC" "$CHANGE_SRC"
+ )
+done) 2>/dev/null
+
+if [ "wiki" != "$1" ]; then
+ echo "'----------------------'-----------------'--------------'----------------'"
+fi