i18n:target support

Bug #98490 reported by Jean-François Doyon
2
Affects Status Importance Assigned to Milestone
Zope 3
Won't Fix
Wishlist
Unassigned
zope.tal
Invalid
Wishlist
Unassigned

Bug Description

I've patched the trunk to enable i18n:target support in the page template implementation. Find the output of "svn diff" attached.

The tests all pass.

I haven't tested this myself, since I'm actually not a Zope 3 user. I use Zope 2 and need the functionality, which I currently enable through a monkey patch.

Let me know if I missed anything, my first time providing a patch in this fashion.

Revision history for this message
Jean-François Doyon (jdoyon) wrote :
Revision history for this message
Philipp von Weitershausen (philikon) wrote :

I'm a bit skeptical because we now make engines take another keyword argument in their translate() method. Not sure if this is a good idea, it might break backward-compatibility.

Either way, this patch should come with an accompanying test that demonstrates i18n:target now actually works. "I've tested it myself" isn't enough because the rest of can't repeat it. Furthermore, we can't repeat it in an automated fashion. That's why we require unit tests.

There are plenty of existing tests that you can probably just enhance with one for i18n:target.

Revision history for this message
Jean-François Doyon (jdoyon) wrote :

Re: zope.tal.interfaces.ITALExpressionEngine ...

I can't see any other way to do it? The code mentions "zope.i18n.interfaces.ITranslationDomain.translate" for some reason ... that interface does have a target_language parameter.

It seems the interface was just short a necessary parameter from the beginning, for some reason? Having both interfaces with the same signature seems sensible.

As for tests ... I know, I've just never worked with that whole setup, I'll come up with something :) My first attempt ended in failure.

Revision history for this message
Christian Theune (ctheune) wrote :

This is a feature.

Changed in zope3:
importance: Medium → Wishlist
status: New → Confirmed
Tres Seaver (tseaver)
Changed in zope.tal:
status: New → Confirmed
importance: Undecided → Wishlist
Changed in zope3:
status: Confirmed → Won't Fix
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope.tal project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope.tal.

Changed in zope.tal:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.