Permalink
Browse files

[BUG #6877] fixed division by zero exception

  • Loading branch information...
1 parent 0a23923 commit b9b8adc3f4f38477e12e85f4de28241bcb90dc3a @thron7 thron7 committed Oct 5, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 tool/pylib/generator/code/CodeGenerator.py
View
6 tool/pylib/generator/code/CodeGenerator.py
@@ -1273,8 +1273,12 @@ def printTranslationStats(statsObj):
for locale, data in statsObj.stats.items():
if locale in skip_locales: continue
self._console.nl()
+ if data['total']:
+ percent_ut = 100*len(data['untranslated'])/data['total']
+ else:
+ percent_ut = 0
self._console.debug(
- "%s:\t untranslated entries: %3d%% (%d/%d)" % (locale, 100*len(data['untranslated'])/data['total'],
+ "%s:\t untranslated entries: %3d%% (%d/%d)" % (locale, percent_ut,
len(data['untranslated']), data['total'])
)
self._console.nl()

0 comments on commit b9b8adc

Please sign in to comment.