[Zope3-checkins] SVN: Zope3/trunk/src/zope/i18n/t Added tests for MessageID

Dmitry Vasiliev lists at hlabs.spb.ru
Fri Aug 27 13:15:05 EDT 2004


Stephan Richter wrote:
> On Friday 27 August 2004 07:40, Dmitry Vasiliev wrote:
> 
>>Modified: Zope3/trunk/src/zope/i18n/translationdomain.py
>>===================================================================
>>--- Zope3/trunk/src/zope/i18n/translationdomain.py      2004-08-27 04:53:17
>>UTC (rev 27286) +++
>>Zope3/trunk/src/zope/i18n/translationdomain.py      2004-08-27 11:40:33 UTC
>>(rev 27287) @@ -19,6 +19,8 @@
>> from zope.i18n.simpletranslationdomain import SimpleTranslationDomain
>> from zope.i18n.messageid import MessageID
>> from zope.i18n import interpolate
>>+from zope.component import getUtility
>>+from zope.i18n.interfaces import ITranslationDomain
>> 
>> # The configuration should specify a list of fallback languages for the
>> # site.  If a particular catalog for a negotiated language is not
>>available,
> 
> 
> Why did you add these imports?

The following code uses these imports:

--- Cut translationdomain.py --

         # MessageID attributes override arguments
         if isinstance(msgid, MessageID):
             if msgid.domain != self.domain:
                 util = getUtility(ITranslationDomain, msgid.domain)
                 return util.translate(msgid, mapping, context,
                                       target_language, default)
             else:
                 mapping = msgid.mapping
                 default = msgid.default

-------------------------------

-- 
Dmitry Vasiliev (dima at hlabs.spb.ru)
     http://hlabs.spb.ru


More information about the Zope3-Checkins mailing list