[SCM] live-manual branch, debian-next, updated. debian/3.0_a13-1-12-g2479a8a
chals
chals at altorricon.com
Sun Jul 8 15:45:22 UTC 2012
The following commit has been merged in the debian-next branch:
commit 9a92fa4fc6f2c210715a6f592dc4fb89c1fd9232
Author: chals <chals at altorricon.com>
Date: Sun Jul 8 17:15:25 2012 +0200
Adding po integrity check and message in test target for occasional use.
diff --git a/Makefile b/Makefile
index 9a313e5..ba04375 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,9 @@ all: build
test:
@echo "Checking for syntax errors... [not implemented yet - FIXME]"
@echo "Checking for spelling errors... [not implemented yet - FIXME]"
-
+ @echo ""
+ @echo "You can check the integrity of po files using 'make check'."
+ @echo ""
tidy:
# Removing useless whitespaces at EOL
for FILE in manual/en/*.ssm manual/en/*.ssi; \
@@ -116,3 +118,6 @@ translate:
else \
echo "There are no fuzzy strings to translate." ; \
fi
+
+check:
+ @./manual/bin/po-integrity-check.sh
diff --git a/manual/bin/po-integrity-check.sh b/manual/bin/po-integrity-check.sh
new file mode 100755
index 0000000..f4d5ced
--- /dev/null
+++ b/manual/bin/po-integrity-check.sh
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+# Can't be "set -e". It would not finish checking if it encountered an error.
+#
+# Script to help translators to check the integrity of po files in live-manual.
+#
+# 'msgfmt' performs several checks and outputs some common errors:
+#
+# - Checks format
+# - Checks header
+# - ...
+#
+# We do not want to compile a .mo file so we use /dev/null.
+#
+
+echo ""
+echo "This script can help you check the integrity of po files."
+echo "Select: $(ls -C manual/po) ['a' to see all] ['q' to quit] "
+
+# Creating function
+
+Integrity_check()
+{
+ echo "Checking the integrity of $(ls manual/po/${LANGUAGE}/* | wc -l) po files in ${LANGUAGE}."
+ echo ""
+ for POFILE in manual/po/${LANGUAGE}/*
+ do
+ echo "-$(basename ${POFILE})"
+ echo ""
+ msgfmt --verbose --check --output-file=/dev/null ${POFILE}
+ if [ "$?" -eq "0" ]
+ then
+ echo "-> This .po file is 'GOOD'."
+ echo ""
+ elif [ "$?" -ne "0" ]
+ then
+ echo "-> This .po file might be 'BAD'. Please revise it."
+ echo ""
+ fi
+ done
+}
+
+# Menu.
+
+read LANGUAGE
+
+case "$LANGUAGE" in
+ en) echo "Nothing to be done, really!"
+ ;;
+
+ ca|de|es|fr|it|pt_BR|ro)
+ Integrity_check
+ ;;
+
+ a) for LANGUAGE in manual/po/*
+ do
+ for POFILE in ${LANGUAGE}/*
+ do
+ echo "-Checking $(basename ${POFILE}) integrity in ${LANGUAGE}"
+ echo ""
+ msgfmt --verbose --check --output-file=/dev/null ${POFILE}
+ if [ "$?" -eq "0" ]
+ then
+ echo "->This .po file is 'GOOD'."
+ echo ""
+ elif [ "$?" -ne "0" ]
+ then
+ echo "->This .po file might be 'BAD'. Please revise it."
+ echo ""
+ fi
+ done
+ done
+ ;;
+
+ q) exit 0
+ ;;
+
+ *) echo "No language chosen. Exiting..."
+ ;;
+
+esac
--
live-manual
More information about the debian-live-changes
mailing list