Commit d15abd19 authored by Vincent Pelletier's avatar Vincent Pelletier

Make testTitle also test translations.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32799 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent da7f58b9
......@@ -72,15 +72,68 @@
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td tal:content="string: ${here/portal_url}/portal_skins/erp5_ui_test/Base_createUITestLanguages"></td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>New Languages Added</td>\n
<td></td>\n
</tr>\n
<tal:block tal:repeat="param_dict python: [\n
{\'message\': \'Foo\', \'translation\': \'Woo\', \'language\': \'wo\', \'catalog_id\': \'erp5_ui\'},\n
{\'message\': \'Foos\', \'translation\': \'Woos\', \'language\': \'wo\', \'catalog_id\': \'erp5_content\'},\n
{\'message\': \'Dummy Workflow Action\', \'translation\': \'Muumu Workflow Action\', \'language\': \'wo\', \'catalog_id\': \'erp5_ui\'},\n
{\'message\': \'History\', \'translation\': \'Leeb\', \'language\': \'wo\', \'catalog_id\': \'erp5_ui\'},\n
{\'message\': \'Business Template Definition\', \'translation\': \'Afeer Template Definition\', \'language\': \'wo\', \'catalog_id\': \'erp5_ui\'},\n
]">\n
<tr tal:define="dummy python: param_dict.update({\'root\': here.portal_url()})">\n
<td>open</td>\n
<td tal:content="python: \'%(root)s/portal_skins/erp5_ui_test/Base_addUITestTranslation?message=%(message)s&translation=%(translation)s&language=%(language)s&catalog_id=%(catalog_id)s\' % param_dict"></td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td tal:content="python: \'Translation of %(message)s updated\' % param_dict"/>\n
<td></td>\n
</tr>\n
</tal:block>\n
\n
<tal:block tal:repeat="language python:[\n
(\'\', {\n
\'view\': \'Foo\',\n
\'list\': \'Foos\',\n
\'dialog\': \'Dummy Workflow Action\',\n
\'report\': \'History\',\n
\'quad\': \'Business Template Definition\',\n
}),\n
(\'wo\', {\n
\'view\': \'Woo\',\n
\'list\': \'Woos\',\n
\'dialog\': \'Muumu Workflow Action\',\n
\'report\': \'Leeb\',\n
\'quad\': \'Afeer Template Definition\',\n
}),\n
]">\n
\n
<!-- View mode: title of the form - title of the object -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/view</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>assertTitle</td>\n
<td tal:content="python:\'Foo - Title 0 | %s\' % site_title">Foo - Title 0 | ERP5</td>\n
<td>selectAndWait</td>\n
<td>select_language</td>\n
<td tal:content="python: \'value=%s\' % (language[0], )"/>\n
</tr>\n
\n
<tr>\n
<td>verifyTitle</td>\n
<td tal:content="python:\'%s - Title 0 | %s\' % (language[1][\'view\'], site_title)"/>\n
<td></td>\n
</tr>\n
\n
......@@ -92,8 +145,8 @@
<td></td>\n
</tr>\n
<tr>\n
<td>assertTitle</td>\n
<td tal:content="python:\'Foos | %s\' % site_title">Foos | ERP5</td>\n
<td>verifyTitle</td>\n
<td tal:content="python:\'%s | %s\' % (language[1][\'list\'], site_title)"/>\n
<td></td>\n
</tr>\n
\n
......@@ -106,11 +159,11 @@
<tr>\n
<td>selectAndWait</td>\n
<td>select_action</td>\n
<td>Dummy Workflow Action</td>\n
<td tal:content="python: language[1][\'dialog\']"/>\n
</tr>\n
<tr>\n
<td>assertTitle</td>\n
<td tal:content="python:\'Dummy Workflow Action | %s\' % site_title">Dummy Workflow Action | ERP5</td>\n
<td>verifyTitle</td>\n
<td tal:content="python:\'%s | %s\' % (language[1][\'dialog\'], site_title)"/>\n
<td></td>\n
</tr>\n
\n
......@@ -121,8 +174,8 @@
<td></td>\n
</tr>\n
<tr>\n
<td>assertTitle</td>\n
<td tal:content="python:\'History - Title 0 | %s\' % site_title">History - Title 0 | ERP5</td>\n
<td>verifyTitle</td>\n
<td tal:content="python:\'%s - Title 0 | %s\' % (language[1][\'report\'], site_title)"/>\n
<td></td>\n
</tr>\n
\n
......@@ -134,10 +187,11 @@
<td></td>\n
</tr>\n
<tr>\n
<td>assertTitle</td>\n
<td tal:content="python:\'Business Template Definition - Title 0 | %s\' % site_title">Business Template Definition - Title 0 | ERP5</td>\n
<td>verifyTitle</td>\n
<td tal:content="python:\'%s - Title 0 | %s\' % (language[1][\'quad\'], site_title)"/>\n
<td></td>\n
</tr>\n
</tal:block>\n
\n
<!-- portal: title of the portal -->\n
<tr>\n
......
......@@ -53,8 +53,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>context.getPortalObject().Localizer.erp5_ui.gettext(message)\n
context.getPortalObject().Localizer.erp5_ui.message_edit(message=message, language=language, translation=translation, note=None)\n
<value> <string>catalog = context.getPortalObject().Localizer[catalog_id]\n
catalog.gettext(message)\n
catalog.message_edit(message=message, language=language, translation=translation, note=None)\n
return "Translation of %s updated" % (message, )\n
</string> </value>
</item>
......@@ -66,7 +67,7 @@ return "Translation of %s updated" % (message, )\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>message, translation, language</string> </value>
<value> <string>message, translation, language, catalog_id=\'erp5_ui\'</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -86,7 +87,7 @@ return "Translation of %s updated" % (message, )\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>3</int> </value>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
......@@ -95,8 +96,11 @@ return "Translation of %s updated" % (message, )\n
<string>message</string>
<string>translation</string>
<string>language</string>
<string>catalog_id</string>
<string>_getitem_</string>
<string>_getattr_</string>
<string>context</string>
<string>catalog</string>
<string>None</string>
</tuple>
</value>
......@@ -109,7 +113,9 @@ return "Translation of %s updated" % (message, )\n
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
<tuple>
<string>erp5_ui</string>
</tuple>
</value>
</item>
<item>
......
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