……
zserver-threads = 8
# If you want Zope to know about any additional eggs, list them here.
# e.g. eggs = ${buildout:eggs} my.package
eggs =
${eggs:main}
environment-vars =
zope_i18n_allowed_languages zh_CN zh_TW en zh
zope_i18n_compile_mo_files false
……
在Plone 模块中可以参考下面代码,访问预定义的环境变量:
import os
COMPILE_MO_FILES_KEY = 'zope_i18n_compile_mo_files'
COMPILE_MO_FILES = os.environ.get(COMPILE_MO_FILES_KEY, False)
ALLOWED_LANGUAGES_KEY = 'zope_i18n_allowed_languages'
ALLOWED_LANGUAGES = os.environ.get(ALLOWED_LANGUAGES_KEY, None)
if ALLOWED_LANGUAGES is not None:
ALLOWED_LANGUAGES = ALLOWED_LANGUAGES.strip().replace(',', ' ')
ALLOWED_LANGUAGES = frozenset(ALLOWED_LANGUAGES.split())