changeset 371:36a99c8244dc

CheckTranslation: adding language selector
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 19 Apr 2009 13:56:47 +0200
parents 5dbd61612452
children 4c9654b4f335
files data/plugin/action/CheckTranslation.py
diffstat 1 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/CheckTranslation.py	Sun Apr 19 13:30:18 2009 +0200
+++ b/data/plugin/action/CheckTranslation.py	Sun Apr 19 13:56:47 2009 +0200
@@ -31,7 +31,7 @@
         pageset = getattr(i18n.strings, pageset_name)
 
     lang = request.values.get('language') or request.lang or 'en'
-    wiki_languages = i18n.wikiLanguages().keys()
+    wiki_languages = sorted(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,12 +79,24 @@
 
     table = DataBrowserWidget(request)
     table.setData(data)
-    content = ''.join(table.format(method='GET'))
+    page_table = ''.join(table.format(method='GET'))
+    
+    fmt = request.formatter
+    this_page = Page(request, pagename)
+    lang_links = [this_page.link_to_raw(request, _lang,
+                                        querystr={'action': 'CheckTranslation',
+                                                  'language': _lang,
+                                                  'pageset': pageset_name, })
+                  for _lang in wiki_languages if _lang != "en"]
+
+
+    lang_selector = u''.join([fmt.paragraph(1), _("Choose:"), ' ', ' '.join(lang_links), fmt.paragraph(0)])
 
     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(lang_selector)
+    request.write(page_table)
     request.write(request.formatter.endContent())
     request.theme.send_footer(pagename)
     request.theme.send_closing_html()