[Zope-dev] zope.18n:translate() keyword arguments versus MessageID attributes

Tres Seaver tseaver at palladion.com
Tue Oct 26 10:13:44 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/26/2010 09:36 AM, Christian Theune wrote:
> Hi,
> 
> I've fiddled a bit with 
> https://bugs.edge.launchpad.net/zope.i18n/+bug/592753 and ended up with 
> an unclear situation:
> 
> The ``translate'' methods of both zope.i18n and ITranslationDomain have 
> optional parameters for the domain/default/mapping attributes of a 
> message ID.
> 
> The message ID attributes always override the parameters but it is not 
> said why. (I probed the tests and they at least verify that this is the 
> case but don't state motivation.)
> 
> As I had to chase this down for quite a while when I originally tried to 
> call zope.i18n.translate() directly (for providing translated emails) it 
> took me quite a while to understand what's going on.
> 
> I see two possibilities for improving the situation:
> 
> - don't implicitly ignore the parameters, but raise an exception if
>    both a message id and at least one of the parameters (domain/default
>    /mapping) is given and write some documentation that explains the
>    situation (what is happening and why)
> 
> or
> 
> - make the parameters take precendence over the message id attributes
> 
> So - why not do the latter?

I prefer the latter, and don't think we need a deprecation cycle for it:
 if the call site is passing in a mapping, that is presumably more
specific than anything stored in the catalog.  I can't see how we would
break anything here, as nobody is likely to have actually used the
feature (since it is effectively a no-op).


Tres.
- -- 
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzG4hgACgkQ+gerLs4ltQ5d0wCgmalGkBVV+TJmXCk4KqiXlM7c
2LQAoNn6oKRQnCACRxzqitdAYnEoUro9
=Kn2D
-----END PGP SIGNATURE-----



More information about the Zope-Dev mailing list