changeset 370:5dbd61612452

CheckTranslation: transforming it into a real action
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 19 Apr 2009 13:30:18 +0200
parents 95269fc6bc51
children 36a99c8244dc
files data/plugin/action/CheckTranslation.py
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/CheckTranslation.py	Sun Apr 19 13:01:52 2009 +0200
+++ b/data/plugin/action/CheckTranslation.py	Sun Apr 19 13:30:18 2009 +0200
@@ -21,7 +21,6 @@
             
 def execute(pagename, request):
     _ = request.getText
-    wiki_languages = i18n.wikiLanguages().keys()
 
     pageset_name = request.values.get('pageset')
     try:
@@ -31,7 +30,8 @@
         pageset_name = 'all_pages'
         pageset = getattr(i18n.strings, pageset_name)
 
-    lang = request.values.get('language') or (request.user.valid and request.user.language) or 'en'
+    lang = request.values.get('language') or request.lang or 'en'
+    wiki_languages = i18n.wikiLanguages().keys()
     if lang == "en" or lang not in wiki_languages:
         msg = _("Please select another language than '%s' for this action (%s)") % (
               lang, ' '.join(wiki_languages))
@@ -79,9 +79,12 @@
 
     table = DataBrowserWidget(request)
     table.setData(data)
+    content = ''.join(table.format(method='GET'))
 
-    msg = ''.join(table.format(method='GET'))
-    msg = "Pages and their translations to '%s' of pageset '%s' %s" % (lang, pageset_name, msg)
-    request.theme.add_msg(msg, "info")
-    Page(request, pagename).send_page()
-
+    title = _("Checking translation '%s' for page set '%s'") % (lang, pageset_name)
+    request.theme.send_title(title, page=request.page, pagename=pagename)
+    request.write(request.formatter.startContent("content"))
+    request.write(content)
+    request.write(request.formatter.endContent())
+    request.theme.send_footer(pagename)
+    request.theme.send_closing_html()