Closed mmerickel closed 7 years ago
Instead of pyramid_i18n_helper.root_package_directory and .root_package_name you could store these values in the application registry such that the helper can be used for multiple apps in the same process. This is a simple fix.
pyramid_i18n_helper.root_package_directory
.root_package_name
from pyramid.decorator import reify class I18NHelper(object): def __init__(self, package): self.package = package @reify def package_dir(self): return os.path.abspath(os.path.dirname(config.root_package.__file__)) @reify def package_name(self): return os.path.basename(config.root_package.__file__) def includeme(config): config.registry['i18n_helper'] = I18NHelper(config.root_package) def some_view(request): helper = request.registry['i18n_helper']
I fixed it. Thanks
Instead of
pyramid_i18n_helper.root_package_directory
and.root_package_name
you could store these values in the application registry such that the helper can be used for multiple apps in the same process. This is a simple fix.