Skip to content

Commit

Permalink
Fix problems with zope_i18n_compile_mo_files early assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Dec 7, 2021
1 parent 825fea4 commit f154e37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Expand Up @@ -5,7 +5,9 @@
4.8.1 (unreleased)
==================

- Nothing changed yet.
- Fix problems with ``zope_i18n_compile_mo_files`` early assignment to
module variable in ``config.py`` in a non-breaking way.
See also `Zope issue #994 <https://github.com/zopefoundation/Zope/issues/994>`_


4.8.0 (2021-09-07)
Expand Down
8 changes: 7 additions & 1 deletion src/zope/i18n/config.py
Expand Up @@ -6,7 +6,13 @@
COMPILE_MO_FILES_KEY = 'zope_i18n_compile_mo_files'
#: Whether or not the ZCML directives will attempt to compile
#: translation files. Defaults to False.
COMPILE_MO_FILES = os.environ.get(COMPILE_MO_FILES_KEY, False)


def _getter_compile_mo_files():
return os.environ.get(COMPILE_MO_FILES_KEY, False)


COMPILE_MO_FILES = property(_getter_compile_mo_files)

#: The environment variable that is consulted when this module
#: is imported to determine the value of `ALLOWED_LANGUAGES`.
Expand Down

0 comments on commit f154e37

Please sign in to comment.