changeset 402:307fabac5d71

Fix `babel.support.Translations.__repr__` and make it less stupid; Include the project name and version defined on the catalog loaded.
author palgarvio
date Tue, 05 Aug 2008 23:30:50 +0000
parents 7826d8e9998f
children dc2f49f83087
files babel/support.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/babel/support.py
+++ b/babel/support.py
@@ -281,8 +281,8 @@
     def __setitem__(self, key, value):
         self.value[key] = value
 
-
-class Translations(gettext.GNUTranslations):
+    
+class Translations(gettext.GNUTranslations, object):
     """An extended translation catalog class."""
 
     DEFAULT_DOMAIN = 'messages'
@@ -321,7 +321,7 @@
     def merge(self, translations):
         """Merge the given translations into the catalog.
         
-        Message translations in the specfied catalog override any messages with
+        Message translations in the specified catalog override any messages with
         the same identifier in the existing catalog.
         
         :param translations: the `Translations` instance with the messages to
@@ -336,4 +336,5 @@
         return self
 
     def __repr__(self):
-        return "<%s>" % (type(self).__name__)
+        return '<%s: "%s">' % (type(self).__name__,
+                               self._info.get('project-id-version'))
Copyright (C) 2012-2017 Edgewall Software