From ab97115afaa8820ea564f112b6ca69becbe209d7 Mon Sep 17 00:00:00 2001 From: Pere Pujal i Carabantes Date: Sat, 16 Nov 2013 23:55:21 +0000 Subject: [PATCH] More checks in check_translations.sh --- src/po/check_translations.sh | 50 ++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/src/po/check_translations.sh b/src/po/check_translations.sh index 0e6baa054..efdc223ef 100755 --- a/src/po/check_translations.sh +++ b/src/po/check_translations.sh @@ -8,7 +8,7 @@ tpconfig_directory=../../../tuxpaint-config NUMBER_OF_LANGUAGES=0 -if [ "a$1b" == "a-hb" ] || [ "a$1b" == "a--helpa" ]; then +if [ "a$1b" == "a-hb" ] || [ "a$1b" == "a--helpb" ]; then echo "usage: $0 or" echo "usage: $0 [file1.po file2.po ...] " exit @@ -36,10 +36,26 @@ fi tpconfig_directory_found=0 if [ -d $tpconfig_directory ]; -then tpconfig_directory_found=1 +then + tpconfig_directory_found=1 + NUM_LANGS=0 + echo -n Checking NUM_LANGS in tuxpaint-config2.cxx... + echo -n NUM_LANGS:_`cat $tpconfig_directory/src/tuxpaint-config2.cxx| grep "define NUM_LANGS"|sed 's/.*ANGS //g'`_ + + for item in `cat $tpconfig_directory/src/tuxpaint-config2.cxx|sed -n '/Use system/,/};/{/NUM_LANGS/d;/};/d;s/.*, "//g;s/"}.*//g;p}'` + do + ((NUM_LANGS++)) + done + echo Counted $NUM_LANGS fi +echo -n "Number of files " +# Only adding the .pot file if we check for all languages +if [ "ab" == "a$1b" ]; then ((NUMBER_OF_LANGUAGES++)); fi +for i in $j; do ((NUMBER_OF_LANGUAGES++)); done +echo $NUMBER_OF_LANGUAGES +NUMBER_OF_LANGUAGES=0 for i in $j @@ -138,6 +154,36 @@ do if [ $configlang -eq 0 ]; then echo _WARNING_ $langname is missing in lang in tuxpaint-config2.cxx; fi fi + echo -n Checking in the manpage... + manlang=0 + for item in `cat ../manpage/tuxpaint.1|sed -n '/american-english/,/.RE/{/RE/d;/TP/d;/^-/d;s/|//g;p}'` + do + if [ $item == $langname ]; then echo OK $item; manlang=1; break; fi + done + if [ $manlang -eq 0 ]; then echo _WARNING_ $langname is missing in lang in ../manpage/tuxpaint.1; fi + + + echo -n Checking LANGUAGE table in OPTIONS.html... + OPTIONSlang=0 + for item in `cat ../../docs/html/OPTIONS.html|sed -n '/english/,/table>/{/tr>/d;/table>/d;/nbsp/d;s///g;s/<\/code><\/td>//g;p}'` + do + if [ $item == $langname ]; then echo OK $item; OPTIONSlang=1; break; fi + done + if [ $OPTIONSlang -eq 0 ]; then echo _WARNING_ $langname is missing in "Available Options" in the lang=LANGUAGE table in ../../docs/html/OPTIONS.html; fi + + + + + echo -n Checking Locale Code in OPTIONS.html... + OPTIONSlocale=0 + for item in `cat ../../docs/html/OPTIONS.html|sed -n '/English/,/table>/{/tr>/d;/table>/d;/nbsp/d;s///g;s/<\/code>.*//g;//d;p}'` + do + if [ $item == $locale ]; then echo OK $item; OPTIONSlocale=1; break; fi + done + if [ $OPTIONSlocale -eq 0 ]; then echo _WARNING_ $locale is missing in the "Available Languages" table in the "Locale Code" field in ../../docs/html/OPTIONS.html; fi + + + echo -n Checking $locale in show_locale_usage ...