changeset 379:bc9abf2a8b6d

CheckTranslation: add some magic when called from MoinI18n/xx
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 19 Apr 2009 18:34:39 +0200
parents 929a932ea415
children f58386c66150
files data/plugin/action/CheckTranslation.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/CheckTranslation.py	Sun Apr 19 16:57:01 2009 +0200
+++ b/data/plugin/action/CheckTranslation.py	Sun Apr 19 18:34:39 2009 +0200
@@ -33,7 +33,14 @@
         pageset_name = 'all_pages'
     pageset = getattr(i18n.strings, pageset_name)
 
-    lang = request.values.get('language') or request.lang or 'en'
+    if pagename.startswith(u"MoinI18n/"):
+        # if we get called from one of the pages on MoinMaster that contain
+        # the .po file data, we assume that user wants to check THAT language:
+        lang_default = pagename[9:]
+    else:
+        # use browser/settings language
+        lang_default = request.lang or 'en'
+    lang = request.values.get('language') or lang_default
     wiki_languages = sorted(i18n.wikiLanguages().keys())
     if lang not in wiki_languages:
         msg = _("We have no translation for '%s', falling back to 'en'!") % lang