|
@@ -5,6 +5,8 @@ import babel
|
|
from flask_babelex import Domain, get_locale
|
|
from flask_babelex import Domain, get_locale
|
|
from flask_plugins import get_plugins_list
|
|
from flask_plugins import get_plugins_list
|
|
|
|
|
|
|
|
+from flaskbb._compat import PY2
|
|
|
|
+
|
|
|
|
|
|
class FlaskBBDomain(Domain):
|
|
class FlaskBBDomain(Domain):
|
|
def __init__(self, app):
|
|
def __init__(self, app):
|
|
@@ -50,6 +52,15 @@ class FlaskBBDomain(Domain):
|
|
if not isinstance(translations, babel.support.Translations):
|
|
if not isinstance(translations, babel.support.Translations):
|
|
return translations
|
|
return translations
|
|
|
|
|
|
|
|
+ # Plugin translations are at the moment not supported under
|
|
|
|
+ # Python 3. There is currently a bug in Babel where it is
|
|
|
|
+ # not possible to merge two message catalogs.
|
|
|
|
+ # https://github.com/mitsuhiko/babel/pull/92
|
|
|
|
+ # So instead of adding/merging them, we are just skipping them
|
|
|
|
+ # Better then no python3 support though..
|
|
|
|
+ if not PY2:
|
|
|
|
+ return translations
|
|
|
|
+
|
|
# now load and add the plugin translations
|
|
# now load and add the plugin translations
|
|
for plugin in self.plugin_translations:
|
|
for plugin in self.plugin_translations:
|
|
plugin_translation = babel.support.Translations.load(
|
|
plugin_translation = babel.support.Translations.load(
|