aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tools/translate.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/tools/translate.py')
-rw-r--r--mediagoblin/tools/translate.py22
1 files changed, 4 insertions, 18 deletions
diff --git a/mediagoblin/tools/translate.py b/mediagoblin/tools/translate.py
index 5ab62a07..01cabe6a 100644
--- a/mediagoblin/tools/translate.py
+++ b/mediagoblin/tools/translate.py
@@ -60,31 +60,17 @@ def get_locale_from_request(request):
Figure out what target language is most appropriate based on the
request
"""
- request_form = request.GET or request.POST
+ request_form = request.GET or request.form
if request_form.has_key('lang'):
return locale_to_lower_upper(request_form['lang'])
- # Your routing can explicitly specify a target language
- matchdict = request.matchdict or {}
-
- if matchdict.has_key('locale'):
- target_lang = matchdict['locale']
- elif request.session.has_key('target_lang'):
+ if 'target_lang' in request.session:
target_lang = request.session['target_lang']
# Pull the first acceptable language or English
else:
- # WebOb recently changed how it handles determining best language.
- # Here's a compromise commit that handles either/or...
- if hasattr(request.accept_language, "best_matches"):
- accept_lang_matches = request.accept_language.best_matches()
- if accept_lang_matches:
- target_lang = accept_lang_matches[0]
- else:
- target_lang = 'en'
- else:
- target_lang = request.accept.best_match(
- request.accept_language, 'en')
+ # TODO: Internationalization broken
+ target_lang = 'en'
return locale_to_lower_upper(target_lang)