Fixes where User id in API would return url rather than host
[mediagoblin.git] / mediagoblin / mg_globals.py
index 8c7c64c2b1665a1c7d9ab50054f0056288d00f73..26ed66fab87eedae3fcfb22210e9efb114457c65 100644 (file)
@@ -29,9 +29,6 @@ import threading
 # SQL database engine
 database = None
 
-# beaker's cache manager
-cache = None
-
 # should be the same as the 
 public_store = None
 queue_store = None
@@ -42,8 +39,13 @@ workbench_manager = None
 # A thread-local scope
 thread_scope = threading.local()
 
-# gettext (this will be populated on demand with gettext.Translations)
-thread_scope.translations = None
+# gettext (this needs to default to English so it doesn't break
+#   in case we're running a script without the app like
+#   ./bin/gmg theme assetlink)
+thread_scope.translations = gettext.translation(
+    'mediagoblin',
+    pkg_resources.resource_filename(
+        'mediagoblin', 'i18n'), ['en'], fallback=True)
 
 # app and global config objects
 app_config = None