Fixing translations stuff for command line tools and such.
We had switched mg_globals to have the default translations set to None so that it would be set up by the mediagoblin app later. However, this would mean that things like scripts would try to call gettext and error out. Thanks to Tumulte for catching this. This commit sponsored by Aurimas Fišeras. Thank you!
This commit is contained in:
parent
aecd65b789
commit
a808364e7f
@ -42,8 +42,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
|
||||
|
Loading…
x
Reference in New Issue
Block a user