Commit 634cea46 authored by Vincent Pelletier's avatar Vincent Pelletier

Follow new translation domain settings API.

changeTranslations was removed in c60e89fe in favour of single-value,
better-named setter.
parent ead071d4
...@@ -69,8 +69,8 @@ module_portal_type_value.edit(\n ...@@ -69,8 +69,8 @@ module_portal_type_value.edit(\n
type_base_category_list=(\'business_application\',),\n type_base_category_list=(\'business_application\',),\n
type_group=\'module\')\n type_group=\'module\')\n
# initialize translation domains\n # initialize translation domains\n
module_portal_type_value.changeTranslations(\n module_portal_type_value.setTranslationDomain(\'title\', \'erp5_ui\')\n
properties=dict(title=\'erp5_ui\', short_title=\'erp5_ui\'))\n module_portal_type_value.setTranslationDomain(\'short_title\', \'erp5_ui\')\n
\n \n
module_list_form_id = (\'%s_view%sList\' % (module_portal_type,\n module_list_form_id = (\'%s_view%sList\' % (module_portal_type,\n
object_portal_type)).replace(\' \', \'\')\n object_portal_type)).replace(\' \', \'\')\n
......
...@@ -48,9 +48,9 @@ class TestContentTranslation(ERP5TypeTestCase): ...@@ -48,9 +48,9 @@ class TestContentTranslation(ERP5TypeTestCase):
def afterSetUp(self): def afterSetUp(self):
# set up translation domain on Person type information. # set up translation domain on Person type information.
from Products.ERP5Type.Accessor.Translation import TRANSLATION_DOMAIN_CONTENT_TRANSLATION from Products.ERP5Type.Accessor.Translation import TRANSLATION_DOMAIN_CONTENT_TRANSLATION
self.portal.portal_types.Person.changeTranslations( setTranslationDomain = self.portal.portal_types.Person.setTranslationDomain
dict(first_name=TRANSLATION_DOMAIN_CONTENT_TRANSLATION, setTranslationDomain('first_name', TRANSLATION_DOMAIN_CONTENT_TRANSLATION)
last_name=TRANSLATION_DOMAIN_CONTENT_TRANSLATION)) setTranslationDomain('last_name', TRANSLATION_DOMAIN_CONTENT_TRANSLATION)
def testCatalogSearch(self): def testCatalogSearch(self):
""" """
......
...@@ -2410,8 +2410,8 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -2410,8 +2410,8 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self.assertEquals(['foo'], self.portal.Localizer.erp5_ui._translated) self.assertEquals(['foo'], self.portal.Localizer.erp5_ui._translated)
# we can change the translation domain on the portal type # we can change the translation domain on the portal type
self.portal.portal_types.Person.changeTranslations( self.portal.portal_types.Person.setTranslationDomain('dummy',
dict(dummy='erp5_content')) 'erp5_content')
transaction.commit() transaction.commit()
self.assertEquals('erp5_content', doc.getDummyTranslationDomain()) self.assertEquals('erp5_content', doc.getDummyTranslationDomain())
...@@ -2428,8 +2428,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -2428,8 +2428,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
# if domain is empty, no translation is performed # if domain is empty, no translation is performed
doc = self.portal.person_module.newContent(portal_type='Person') doc = self.portal.person_module.newContent(portal_type='Person')
self.portal.Localizer = DummyLocalizer() self.portal.Localizer = DummyLocalizer()
self.portal.portal_types.Person.changeTranslations( self.portal.portal_types.Person.setTranslationDomain('dummy', None)
dict(dummy=None))
transaction.commit() transaction.commit()
doc.setDummy('foo') doc.setDummy('foo')
......
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