Commit cedf10cc authored by Arnaud Fontaine's avatar Arnaud Fontaine

Move getTranslationDomainNameList to PropertySheetTool as it's being used in portal_property_sheets

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38706 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 86069b68
......@@ -28,6 +28,8 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
from Products.ERP5Type.Accessor import Translation
from Products.CMFCore.utils import getToolByName
class PropertySheetTool(BaseTool):
......@@ -39,3 +41,12 @@ class PropertySheetTool(BaseTool):
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
security.declarePublic('getTranslationDomainNameList')
def getTranslationDomainNameList(self):
return (['']+
[object_.id
for object_ in getToolByName(self, 'Localizer').objectValues()
if object_.meta_type=='MessageCatalog']+
[Translation.TRANSLATION_DOMAIN_CONTENT_TRANSLATION]
)
......@@ -26,7 +26,6 @@ from Acquisition import aq_base, Implicit
import Products
from Products.ERP5Type.Accessor import Translation
from Products.CMFCore.utils import getToolByName
from zLOG import LOG
......@@ -107,15 +106,6 @@ class TranslationProviderBase(object):
result.append(property_name)
return result
security.declarePublic('getTranslationDomainNameList')
def getTranslationDomainNameList(self):
return (['']+
[object_.id
for object_ in getToolByName(self, 'Localizer').objectValues()
if object_.meta_type=='MessageCatalog']+
[Translation.TRANSLATION_DOMAIN_CONTENT_TRANSLATION]
)
#
# ZMI methods
#
......@@ -137,7 +127,7 @@ class TranslationProviderBase(object):
# get a list of message catalogs and add empty one for no traduction and
# add another for content translation.
translation_domain_list = self.getTranslationDomainNameList()
translation_domain_list = self.portal_property_sheets.getTranslationDomainNameList()
return self._translation_form( self
, REQUEST
, translations = translation_list
......
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