aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/mg_globals.py
diff options
context:
space:
mode:
authorSebastian Spaeth <Sebastian@SSpaeth.de>2012-12-01 23:35:52 +0100
committerSebastian Spaeth <Sebastian@SSpaeth.de>2012-12-01 23:40:10 +0100
commit7b9f9d1edb96aabab7e35818824b71efbdd4efb9 (patch)
tree5305ce15c5e15355e6bd072599459a661c986d39 /mediagoblin/mg_globals.py
parent7989cd6e4961749a39147c9020dbae745b4f23de (diff)
downloadmediagoblin-7b9f9d1edb96aabab7e35818824b71efbdd4efb9.tar.lz
mediagoblin-7b9f9d1edb96aabab7e35818824b71efbdd4efb9.tar.xz
mediagoblin-7b9f9d1edb96aabab7e35818824b71efbdd4efb9.zip
Fix i18n in our browser
We only ever served english pages since the switch to werkzeug's requests. Fix this by actually checking the accepted languages that our web browser sends and using that or falling back to english. This is not optimal, imaging our browser sends "klingon, de" as accepted languages and we happen to not have a klingon translation ready (a deficiency that should be corrected immediately anyway!!). We would then fall back to english rather than sending the sensible and pleasant German language which the user would understand. This will require more backend work though. Removing the gettext.find() in mg_globals.py. It looked in the wrong directory anyway (mediagoblin/translations) and as that does not exist, had always returned None without anyone noticing. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'mediagoblin/mg_globals.py')
-rw-r--r--mediagoblin/mg_globals.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/mediagoblin/mg_globals.py b/mediagoblin/mg_globals.py
index fffa1dda..356a944d 100644
--- a/mediagoblin/mg_globals.py
+++ b/mediagoblin/mg_globals.py
@@ -45,11 +45,8 @@ workbench_manager = None
# A thread-local scope
thread_scope = threading.local()
-# gettext
-thread_scope.translations = gettext.find(
- 'mediagoblin',
- pkg_resources.resource_filename(
- 'mediagoblin', 'translations'), ['en'])
+# gettext (this will be populated on demand with gettext.Translations)
+thread_scope.translations = None
# app and global config objects
app_config = None