changeset 5988:488a3cd30701

move some i18n debug logging to i18n module
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 04 Jun 2013 22:48:59 +0200
parents e06ce67bcaab
children 4790615ddfb6
files MoinMoin/i18n/__init__.py MoinMoin/wsgiapp.py
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/i18n/__init__.py	Tue May 28 11:22:45 2013 +0200
+++ b/MoinMoin/i18n/__init__.py	Tue Jun 04 22:48:59 2013 +0200
@@ -338,7 +338,11 @@
     request object lang attribute.
     """
     if request.user and request.user.valid and request.user.language:
-        return request.user.language
+        lang = request.user.language
+    else:
+        lang = None
+    logging.debug("userLanguage returns %r" % lang)
+    return lang
 
 
 def requestLanguage(request):
@@ -363,6 +367,7 @@
         # If everything else fails, read the manual... or return 'en'
         else:
             lang = 'en'
+    logging.debug("requestLanguage returns %r" % lang)
     return lang
 
 
--- a/MoinMoin/wsgiapp.py	Tue May 28 11:22:45 2013 +0200
+++ b/MoinMoin/wsgiapp.py	Tue Jun 04 22:48:59 2013 +0200
@@ -232,13 +232,11 @@
     if i18n.languages is None:
         i18n.i18n_init(context)
     lang = i18n.requestLanguage(context)
-    logging.debug("setup_i18n_preauth returns %r" % lang)
     return lang
 
 def setup_i18n_postauth(context):
     """ Determine language for the request after user-id is established. """
     lang = i18n.userLanguage(context) or context.lang
-    logging.debug("setup_i18n_postauth returns %r" % lang)
     return lang
 
 class Application(object):