Re: [Zope3-dev] zope.i18n.translate ignores keyword arguments: desired/expected?

2006-04-11 Thread Fred Drake
On 4/10/06, Gary Poster <[EMAIL PROTECTED]> wrote:
> My strawman is that all non-None `translate` keyword arguments should
> win over msgid values.

+1

> A valid counter-argument for domain, at least, is that this is really
> an attribute of the msgid, and overriding it effectively changes the
> msgid into an entirely different token.  But I'm tempted to go with
> simple logic and just say 'keywords override msgids'.

This is the only one that could be argued, and I'd be swayed by a
reasonable case.  Since no one was forthcoming with a rationale, I'd
be tempted to make the change so the screams can be heard if there's
code that depends on the current behavior.  This kind of thing is what
alphas and betas are intended to rout.


  -Fred

--
Fred L. Drake, Jr.
"Don't let schooling interfere with your education." -- Mark Twain
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] zope.i18n.translate ignores keyword arguments: desired/expected?

2006-04-10 Thread Gary Poster
Hi all.  in zope/i18n/__init__.py, the _translate method used by  
translate, if the msgid is a MessageID or a Message then the domain,  
default, and mapping are all used in preference to keyword arguments,  
even if, for instance, the keyword is non-None and the attribute is  
None.


Because of the immutability of Message, it would be nice if,  
minimally, the mapping keyword were honored.


My strawman is that all non-None `translate` keyword arguments should  
win over msgid values.


A valid counter-argument for domain, at least, is that this is really  
an attribute of the msgid, and overriding it effectively changes the  
msgid into an entirely different token.  But I'm tempted to go with  
simple logic and just say 'keywords override msgids'.


This seems to be in direct opposition with the current code, so I'm  
guessing someone put some thought behind the current behavior.  Would  
anyone care to champion it?


Gary
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com