Open GoogleCodeExporter opened 8 years ago
here's a rough workaround -- effectively disabling the caching of translations.
I've not checked out the performance hit, but it certainly beats having text
coming out in every language imaginable:
from babel.support import LazyProxy
from webapp2_extras import i18n
class LazierProxy(LazyProxy):
def value(self):
return self._func(*self._args, **self._kwargs)
value = property(value)
def lazy_gettext(string, **variables):
'''
https://code.google.com/p/webapp-improved/issues/detail?id=84
'''
return LazierProxy(i18n.gettext, string, **variables)
[then import lazy_gettext from here rather than webapp2_extras.i18n]
Original comment by ohuig...@gmail.com
on 17 Feb 2014 at 10:56
I faced the same issue and the workaround is working for me. Thanks to the OP.
Babel.support.LazyProxy now accepts enable_cache
, which is defaulted to True
.
This should work -
i18n.lazy_gettext(text, enable_cache=False)
Original issue reported on code.google.com by
mytix.m...@gmail.com
on 18 Sep 2013 at 11:37