[Zope-Checkins] CVS: Zope/lib/python/Products/PageTemplates/tests/input - CheckI18nTranslate.html:1.1.2.1 CheckI18nTranslateHooked.html:1.1.2.1

Florent Guillaume fg@nuxeo.com
Sun, 15 Sep 2002 20:43:31 -0400


Update of /cvs-repository/Zope/lib/python/Products/PageTemplates/tests/input
In directory cvs.zope.org:/tmp/cvs-serv6172/lib/python/Products/PageTemplates/tests/input

Added Files:
      Tag: Zope-2_6-i18n-branch
	CheckI18nTranslate.html CheckI18nTranslateHooked.html 
Log Message:
Added a hookable global translation service to PageTemplates, with tests.

A third-party product wishing to add a translation service simply has to
do:
    from Products.PageTemplates.GlobalTranslationService import \
         setGlobalTranslationService
    setGlobalTranslationService(mytranslationservice)
A translation service only needs one method, whose signature is:
    def translate(self, domain, msgid, mapping=None,
                  context=None, target_language=None)
It must return a translated string based on msgid and the domain, and
optionally the other arguments. The translated string can be Unicode.


=== Added File Zope/lib/python/Products/PageTemplates/tests/input/CheckI18nTranslate.html ===
<html>
<body>
<head>
   <p i18n:translate="foobar">baz</p>
</head>
</body>
</html>


=== Added File Zope/lib/python/Products/PageTemplates/tests/input/CheckI18nTranslateHooked.html ===
<html>
<body>
<head>
   <p i18n:domain="foo" i18n:translate="bar">baz</p>
</head>
</body>
</html>