changeset 366:c53c862bd556

action.CeckTranslations: added an optional parameter selection to get another pageslist shown than all_pages (see i18n.strings for list definitions).
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 15 Apr 2009 16:56:12 +0200
parents 951d12e53825
children cee1e71502a7
files data/plugin/action/CheckTranslation.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/CheckTranslation.py	Wed Apr 15 10:56:36 2009 +0200
+++ b/data/plugin/action/CheckTranslation.py	Wed Apr 15 16:56:12 2009 +0200
@@ -18,7 +18,14 @@
 
 def execute(pagename, request):
     _ = request.getText
-    SystemPages = strings.all_pages
+
+    selection = request.values.get('selection') or u'all_pages'
+
+    # ToDo find a better way to use only list definitions
+    if selection.startswith('__') or not selection in dir(strings):
+        selection = u'all_pages'
+
+    SystemPages = getattr(strings, selection)
 
     users_lang = i18n.requestLanguage(request)
     if users_lang == "en":
@@ -65,7 +72,7 @@
     table.setData(data)
 
     msg = ''.join(table.format(method='GET'))
-    msg = "Help pages and their translations %s" % msg
+    msg = "Help pages and their translations of selection: <b>%s</b> %s" % (selection, msg)
     if msg:
         request.theme.add_msg(msg, "info")
     Page(request, pagename).send_page()