[Erp5-report] r9048 - /erp5/trunk/products/ERP5Type/Accessor/Translation.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Aug 4 12:03:15 CEST 2006


Author: yo
Date: Fri Aug  4 12:03:13 2006
New Revision: 9048

URL: http://svn.erp5.org?rev=9048&view=rev
Log:
Use getProperty to get a value instead of hardcoding getTitle.
If a value is empty, do not try to translate it.

Modified:
    erp5/trunk/products/ERP5Type/Accessor/Translation.py

Modified: erp5/trunk/products/ERP5Type/Accessor/Translation.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Accessor/Translation.py?rev=9048&r1=9047&r2=9048&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Accessor/Translation.py (original)
+++ erp5/trunk/products/ERP5Type/Accessor/Translation.py Fri Aug  4 12:03:13 2006
@@ -56,12 +56,11 @@
       LOG("ERP5Type Deprecated Getter Id:",0, self._id)
     domain = instance.getProperty('%s_translation_domain' %
                                   self._original_key)
-    if domain == '':
-      return instance.getTitle()
+    value = instance.getProperty(self._original_key)
+    if domain == '' or not value:
+      return value
     localizer = getToolByName(instance, 'Localizer')
-    return localizer[domain].gettext(
-                  unicode(instance.getTitle(), 'utf8')
-            ).encode('utf8')
+    return localizer[domain].gettext(unicode(value, 'utf8')).encode('utf8')
 
   psyco.bind(__call__)
 




More information about the Erp5-report mailing list