]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Fix for #60.
authorChristopher Lenz <cmlenz@gmail.com>
Fri, 1 Feb 2008 15:30:49 +0000 (15:30 +0000)
committerChristopher Lenz <cmlenz@gmail.com>
Fri, 1 Feb 2008 15:30:49 +0000 (15:30 +0000)
ChangeLog
babel/messages/frontend.py

index cdba6c25df3d41f74dae8efe97f3c9a56d8d3665..9f3bd9d9450dc778a566b87f502000d1e065f829 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,11 +3,14 @@ http://svn.edgewall.org/repos/babel/tags/0.9.2/
 (?, from branches/stable/0.9.x)
 
  * Fixed catalogs' charset values not being recognized (ticket #66).
+ * Numerous improvements to the default plural forms.
  * Fixed fuzzy matching when updating message catalogs (ticket #82).
  * Fixed bug in catalog updating, that in some cases pulled in translations
    from different catalogs based on the same template.
  * Location lines in PO files do no longer get wrapped at hyphens in file
    names (ticket #79).
+ * Fixed division by zero error in catalog compilation on empty catalogs
+   (ticket #60).
 
 
 Version 0.9.1
index d01fdef24926c483ea6c40ad60cba34b9e10af7f..00641e47df1037f0f04729e9dc44ed36db6ae301 100755 (executable)
@@ -147,9 +147,11 @@ class compile_catalog(Command):
                 for message in list(catalog)[1:]:
                     if message.string:
                         translated +=1
+                percentage = 0
+                if len(catalog):
+                    percentage = translated * 100 // len(catalog)
                 log.info('%d of %d messages (%d%%) translated in %r',
-                         translated, len(catalog),
-                         translated * 100 // len(catalog), po_file)
+                         translated, len(catalog), percentage, po_file)
 
             if catalog.fuzzy and not self.use_fuzzy:
                 log.warn('catalog %r is marked as fuzzy, skipping', po_file)
@@ -738,9 +740,11 @@ class CommandLineInterface(object):
                 for message in list(catalog)[1:]:
                     if message.string:
                         translated +=1
+                percentage = 0
+                if len(catalog):
+                    percentage = translated * 100 // len(catalog)
                 self.log.info("%d of %d messages (%d%%) translated in %r",
-                              translated, len(catalog),
-                              translated * 100 // len(catalog), po_file)
+                              translated, len(catalog), percentage, po_file)
 
             if catalog.fuzzy and not options.use_fuzzy:
                 self.log.warn('catalog %r is marked as fuzzy, skipping',