X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=mediagoblin%2Fmg_globals.py;h=fffa1ddae9f083e0aa49fc126607728e5dff6245;hb=325e9bc418b746e5dd281331bfac6f6ac13b045d;hp=3bd2070de2143036eebbf621f0128fdbbb4703ba;hpb=63352aaf70d97a37b6277fab0f9b957d34dcb9df;p=mediagoblin.git diff --git a/mediagoblin/mg_globals.py b/mediagoblin/mg_globals.py index 3bd2070d..fffa1dda 100644 --- a/mediagoblin/mg_globals.py +++ b/mediagoblin/mg_globals.py @@ -19,6 +19,7 @@ In some places, we need to access the database, public_store, queue_store import gettext import pkg_resources +import threading ############################# @@ -41,8 +42,11 @@ queue_store = None # A WorkBenchManager workbench_manager = None +# A thread-local scope +thread_scope = threading.local() + # gettext -translations = gettext.find( +thread_scope.translations = gettext.find( 'mediagoblin', pkg_resources.resource_filename( 'mediagoblin', 'translations'), ['en'])