check_for_tutorial_problems.sh revision 81061faa4c31ed05bc6a6bce988e46830ca62f02
# check the main Inkscape tree for tutorial-related problems
# $1: full name of the root directory of the local copy of the main Inkscape tree
# usage example:
LANG=C
LC_ALL=C
# First pass to detect invalid links to installed tutorials (trailing
# space, typo...).
echo "===== Checking tutorials links in PO files ======"
echo "$PO_FILE_LIST" |\
while read PO_FILENAME; do
echo "----- $PO_FILENAME -----------------------------------"
echo "$PO_FILENAME has $UNTRANSLATED_COUNT untranslated tutorial filenames"
fi
grep "^msgstr \"" |\
while read TUTORIAL_FILENAME_TRANSLATION_LINE; do
if [ ! -e "$1/share/tutorials/$TUTORIAL_FILENAME_TRANSLATION" ]; then
echo -n "$PO_FILENAME references \"$TUTORIAL_FILENAME_TRANSLATION\""
echo " ERROR: THE REFERENCED FILE DOESN'T EXIST, PLEASE CHECK"
fi
done
echo
done
# Second pass to check if a tutorial for a language exists but is not
# linked in the PO file.
echo
echo "===== Checking tutorials not referenced in PO files ======"
echo "$TUTORIAL_FILE_LIST" |\
while read TUTORIAL_FILENAME; do
if [ -e "$1/po/$LANGUAGE_CODE.po" ]; then
TRANSLATIONS_IN_CURRENT_PO=`cat "$1/po/$LANGUAGE_CODE.po" | grep -A 1 "^msgid\ \"tutorial-[^.]*\.svg\""`
if [ $? -ne 0 ]; then
echo "WARNING: $TUTORIAL_FILENAME IS NOT REFERENCED IN $LANGUAGE_CODE.po"
fi
else
echo "WARNING: \"$LANGUAGE_CODE.po\" FILE NOT FOUND"
fi
done
# Last pass to check if tutorials are correctly added in Makefile.am
echo
echo "===== Checking Makefile.am ======"
echo "$TUTORIAL_DIRECTORY_FILELIST" |\
while read TUTORIAL_DIRECTORY_FILENAME; do
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
echo "WARNING: $TUTORIAL_DIRECTORY_FILENAME IS NOT IN Makefile.am"
fi
fi
done