Commit aed00c95 authored by Jérome Perrin's avatar Jérome Perrin

only define _property_domain_dict on the instance, and initialize if needed.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17877 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2578ae7e
...@@ -35,7 +35,6 @@ class TranslationProviderBase: ...@@ -35,7 +35,6 @@ class TranslationProviderBase:
security = ClassSecurityInfo() security = ClassSecurityInfo()
_property_domain_dict = {}
_translation_form = DTMLFile( 'editToolsTranslation', _dtmldir ) _translation_form = DTMLFile( 'editToolsTranslation', _dtmldir )
...@@ -91,7 +90,7 @@ class TranslationProviderBase: ...@@ -91,7 +90,7 @@ class TranslationProviderBase:
property_domain_keys = property_domain_dict.keys() property_domain_keys = property_domain_dict.keys()
property_domain_keys.sort() property_domain_keys.sort()
original_property_domain_keys.sort() original_property_domain_keys.sort()
# Only update if required in order to prevent ZODB to grow # Only update if required in order to prevent ZODB from growing
if property_domain_keys != original_property_domain_keys: if property_domain_keys != original_property_domain_keys:
# Update existing dict # Update existing dict
property_domain_dict.update(original_property_domain_dict) property_domain_dict.update(original_property_domain_dict)
...@@ -103,11 +102,13 @@ class TranslationProviderBase: ...@@ -103,11 +102,13 @@ class TranslationProviderBase:
""" """
Return all the translation defined by a provider. Return all the translation defined by a provider.
""" """
property_domain_dict = getattr(aq_base(self), '_property_domain_dict', _MARKER) property_domain_dict = getattr(aq_base(self),
if len(property_domain_dict) is _MARKER: '_property_domain_dict', _MARKER)
# Force update is not defined # initialize if needed
if property_domain_dict is _MARKER:
self.updateInitialPropertyTranslationDomainDict() self.updateInitialPropertyTranslationDomainDict()
return self._property_domain_dict return self._property_domain_dict
return property_domain_dict
# #
# ZMI methods # ZMI methods
......
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