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

we should always create PropertyTranslationDomainGetter accessors, because

they overwrite a standard accessor created earlier (the standard accessor is
created so that it's possible to set the translation domain on an instance).



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17878 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent aed00c95
...@@ -1173,7 +1173,7 @@ def setDefaultProperties(property_holder, object=None): ...@@ -1173,7 +1173,7 @@ def setDefaultProperties(property_holder, object=None):
# Create translation accesor, if translatable is set # Create translation accesor, if translatable is set
if prop.get('translatable', 0): if prop.get('translatable', 0):
# make accesso like getTranslatedProperty # make accessors like getTranslatedProperty
createTranslationAccessors( createTranslationAccessors(
property_holder, property_holder,
'translated_%s' % (prop['id']), 'translated_%s' % (prop['id']),
...@@ -2445,8 +2445,8 @@ def createTranslationAccessors(property_holder, id, ...@@ -2445,8 +2445,8 @@ def createTranslationAccessors(property_holder, id,
if 'translation_domain' in id: if 'translation_domain' in id:
# Getter # Getter
accessor_name = 'get' + UpperCase(id) accessor_name = 'get' + UpperCase(id)
if not hasattr(property_holder, accessor_name): property_holder.registerAccessor(accessor_name, id,
property_holder.registerAccessor(accessor_name, id, Translation.PropertyTranslationDomainGetter, ()) Translation.PropertyTranslationDomainGetter, ('string', default,))
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
......
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