def set_i18n(i18n, key=_i18n_registry_key, request=None):
"""Sets an instance of :class:`I18n` in the request registry.
:param store:
An instance of :class:`I18n`.
:param key:
The key used to retrieve the instance from the registry. A default
is used if it is not set.
:param request:
A :class:`webapp2.Request` instance used to retrieve the instance. The
active request is used if it is not set.
"""
request = request or webapp2.get_request()
request.registry[key] = i18n
评论列表
文章目录