changeset 373:0edec6b35559

CheckTranslation: if lang selection is invalid, give notice and fall back to 'en'
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 19 Apr 2009 15:06:24 +0200
parents 4c9654b4f335
children e93b8be38fcc
files data/plugin/action/CheckTranslation.py
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/CheckTranslation.py	Sun Apr 19 14:19:07 2009 +0200
+++ b/data/plugin/action/CheckTranslation.py	Sun Apr 19 15:06:24 2009 +0200
@@ -29,12 +29,10 @@
 
     lang = request.values.get('language') or request.lang or 'en'
     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))
+    if lang not in wiki_languages:
+        msg = _("We have no translation for '%s', falling back to 'en'!") % lang
         request.theme.add_msg(msg, "err")
-        Page(request, pagename).send_page()
-        return
+        lang = 'en'
 
     def trans(text, request=request, lang=lang, **kw):
         return i18n.getText(text, request, lang, **kw)