Commit 62b46510 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Use getProperty to get a value instead of hardcoding getTitle.

If a value is empty, do not try to translate it.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9048 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d416ef9b
......@@ -56,12 +56,11 @@ class TranslatedPropertyGetter(Method):
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__)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment