[Zope3-checkins]
SVN: Zope3/trunk/src/zope/app/applicationcontrol/browser/
Translations now shown grouped by domains.
Dmitry Vasiliev
dima at hlabs.spb.ru
Mon Apr 18 09:24:53 EDT 2005
Log message for revision 30019:
Translations now shown grouped by domains.
Changed:
U Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_translationdomaincontrol.py
U Zope3/trunk/src/zope/app/applicationcontrol/browser/translationdomaincontrol.pt
U Zope3/trunk/src/zope/app/applicationcontrol/browser/translationdomaincontrol.py
-=-
Modified: Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_translationdomaincontrol.py
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_translationdomaincontrol.py 2005-04-18 12:08:10 UTC (rev 30018)
+++ Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_translationdomaincontrol.py 2005-04-18 13:24:53 UTC (rev 30019)
@@ -37,7 +37,8 @@
'domain': u'zope',
'RELOAD': u'Reload'})
body = response.getBody()
- self.assert_('Message Catalog successfully reloaded.' in body)
+ self.assert_('Message Catalog for de language in zope domain'
+ ' successfully reloaded.' in body)
def test_suite():
Modified: Zope3/trunk/src/zope/app/applicationcontrol/browser/translationdomaincontrol.pt
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/browser/translationdomaincontrol.pt 2005-04-18 12:08:10 UTC (rev 30018)
+++ Zope3/trunk/src/zope/app/applicationcontrol/browser/translationdomaincontrol.pt 2005-04-18 13:24:53 UTC (rev 30019)
@@ -10,30 +10,39 @@
tal:condition="status"
tal:content="status" />
- <table>
+ <div tal:repeat="domainInfo view/getCatalogsInfo">
- <tr>
- <th i18n:translate="">Domain</th>
+ <div class="row">
+ <div class="label" i18n:translate="">Domain</div>
+ <div class="field" tal:content="domainInfo/domain">domain</div>
+ </div>
+
+ <table class="listing">
+
+ <thead>
+ <tr>
<th i18n:translate="">Language</th>
<th i18n:translate="">Files</th>
<th> </th>
- </tr>
+ </tr>
+ </thead>
- <tr tal:repeat="catalogInfo view/getCatalogsInfo">
- <td tal:content="catalogInfo/domain"></td>
- <td tal:content="catalogInfo/language"></td>
+ <tr tal:repeat="catalogInfo domainInfo/languagesInfo">
+ <td tal:content="catalogInfo/language"></td>
<td>
- <div tal:repeat="fileName catalogInfo/fileNames"
+ <div tal:repeat="fileName catalogInfo/fileNames"
tal:content="fileName"></div>
</td>
<td>
- <a tal:attributes="href string:?RELOAD=&domain=${catalogInfo/domain}&language=${catalogInfo/language}"
+ <a tal:attributes="href string:?RELOAD=&domain=${domainInfo/domain}&language=${catalogInfo/language}"
i18n:translate="reload-button">Reload</a>
</td>
</tr>
</table>
-
+
</div>
+
+ </div>
</body>
</html>
Modified: Zope3/trunk/src/zope/app/applicationcontrol/browser/translationdomaincontrol.py
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/browser/translationdomaincontrol.py 2005-04-18 12:08:10 UTC (rev 30018)
+++ Zope3/trunk/src/zope/app/applicationcontrol/browser/translationdomaincontrol.py 2005-04-18 13:24:53 UTC (rev 30019)
@@ -21,6 +21,7 @@
from zope.app import zapi
from zope.app.i18n import ZopeMessageIDFactory as _
+
class TranslationDomainControlView(object):
def getCatalogsInfo(self):
@@ -28,17 +29,17 @@
for name, domain in zapi.getUtilitiesFor(ITranslationDomain):
if not hasattr(domain, 'getCatalogsInfo'):
continue
+ lang_info = []
+ info.append({'domain': name, 'languagesInfo': lang_info})
for language, fileNames in domain.getCatalogsInfo().items():
- info.append({'domain': name,
- 'language': language,
+ lang_info.append({'language': language,
'fileNames': fileNames})
return info
-
def reloadCatalogs(self):
"""Do the reloading !"""
status = ''
-
+
if 'RELOAD' in self.request:
language = self.request.get('language')
domain = self.request.get('domain')
@@ -48,6 +49,9 @@
if lang == language:
domain.reloadCatalogs(fileNames)
- status = _('Message Catalog successfully reloaded.')
+ status = _('Message Catalog for ${language} language'
+ ' in ${domain} domain successfully reloaded.')
+ status.mapping['language'] = language
+ status.mapping['domain'] = domain.domain
return status
More information about the Zope3-Checkins
mailing list