[rkward-cvs] SF.net SVN: rkward:[4322] trunk/rkward/po/compile_po.cmake
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Fri Sep 28 15:06:47 UTC 2012
Revision: 4322
http://rkward.svn.sourceforge.net/rkward/?rev=4322&view=rev
Author: tfry
Date: 2012-09-28 15:06:47 +0000 (Fri, 28 Sep 2012)
Log Message:
-----------
Make sure to print warnings, and don't correct calculation of percentage when there are fuzzy messages
Modified Paths:
--------------
trunk/rkward/po/compile_po.cmake
Modified: trunk/rkward/po/compile_po.cmake
===================================================================
--- trunk/rkward/po/compile_po.cmake 2012-09-28 09:23:12 UTC (rev 4321)
+++ trunk/rkward/po/compile_po.cmake 2012-09-28 15:06:47 UTC (rev 4322)
@@ -1,7 +1,8 @@
# helper script, which will compile a po into a gmo, if, and only if it is at least 80% translated.
# this is basically, because ADD_CUSTOM_COMMAND won't capture stdout, and EXECUTE_PROCESS
# can't be made to re-run when the po-file changes.
-EXECUTE_PROCESS(COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check --statistics -o ${_gmoFile} ${_poFile}
+EXECUTE_PROCESS(COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_poFile}) # For printing any errors / warnings
+EXECUTE_PROCESS(COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --statistics -o ${_gmoFile} ${_poFile} # Second run to grab stats
ERROR_VARIABLE MSGFMT_STATS ERROR_STRIP_TRAILING_WHITESPACE)
# Try to extract statistics information on translated vs. untranslated strings
@@ -12,8 +13,11 @@
IF(MSGFMT_COUNTS_COUNT LESS 2)
LIST(APPEND MSGFMT_COUNTS 0) # This means X translated, and no untranslated strings
ENDIF(MSGFMT_COUNTS_COUNT LESS 2)
+IF(MSGFMT_COUNTS_COUNT LESS 3)
+ LIST(INSERT MSGFMT_COUNTS 1 0) # This means X translated, no fuzzy, Y untranslated strings
+ENDIF(MSGFMT_COUNTS_COUNT LESS 3)
LIST(GET MSGFMT_COUNTS 0 TRANSLATED_COUNT)
-LIST(GET MSGFMT_COUNTS 1 UNTRANSLATED_COUNT)
+LIST(GET MSGFMT_COUNTS 2 UNTRANSLATED_COUNT)
MATH(EXPR TRANSLATION_RATIO "${TRANSLATED_COUNT}*100/(${TRANSLATED_COUNT}+${UNTRANSLATED_COUNT})")
# Purge hopelessly incomplete translations
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list