From cdae91d72b7bfa5edb26e12e721891a3ce2f2aa7 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 19 Apr 2010 08:58:54 +0000 Subject: Pass along translate function to templates. --- repoze/bfg/interfaces.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'repoze/bfg/interfaces.py') diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py index 92003a9f9..f09ad7e36 100644 --- a/repoze/bfg/interfaces.py +++ b/repoze/bfg/interfaces.py @@ -232,10 +232,16 @@ VH_ROOT_KEY = 'HTTP_X_VHM_ROOT' class ITranslatorFactory(Interface): """ Internal interface representing an i18n translator factory """ - def __call__(self, request): + def __call__(request): """ Return a translator """ class ITranslator(Interface): - def __call__(self, tstr): + def __call__(tstr): """ Return a translation based on the translation string tstr """ - + +class IChameleonTranslate(Interface): + """ Internal interface representing a chameleon translate function """ + def __call__(msgid, domain=None, mapping=None, context=None, + target_language=None, default=None): + """ Translate a mess of arguments to a Unicode object """ + -- cgit v1.2.3