[Zope-Coders] Proposal: put i18n into 2.6

Florent Guillaume fg@nuxeo.com
13 Sep 2002 15:52:11 +0200


On Fri, 2002-09-13 at 15:35, Casey Duncan wrote:
> I believe the plan is for 2.7 and 2.6 to come out very close together. 2.=
7=20
> will require Python 2.2.x, whereas 2.6 still runs on 2.1.x. Since tal i18=
n=20
> comes from Zope 3, it requires Python2.2.

Well it works very well today in 2.6 with python 2.1. The only change to
the code needed to make it work is this:

--- lib/python/TAL/ITALES.py.Zope27     Tue Jul 30 22:12:52 2002
+++ lib/python/TAL/ITALES.py    Tue Sep 10 18:12:18 2002
@@ -3,2 +3,7 @@
-from Interface import Interface
-from Interface.Attribute import Attribute
+try:
+    from Interface import Interface
+    from Interface.Attribute import Attribute
+except ImportError:
+    # before 2.7, no Interface module
+    class Interface: pass
+    def Attribute(*args): pass

> Jim's idea is that 2.7 will not differ much feature-wise from 2.6, except=
 for=20
> a couple of things backported from Zope 3 (tal i18n being one of them). T=
he=20
> major difference will be the Python version supported.
>=20
> If this proves true, the effort to get tal i18n in Zope 2.6 wouldn't be=20
> fruitful, unless you were bound to Python 2.1.x for some other reason.

The effort was very very small, and I've already done it.

> At the very least the time between 2.6 and 2.7 will be *much* less then f=
rom=20
> 2.5 to 2.6.

But as I understand it its main focus will be a beginning of
ComponentArchitecture. Why deprive ourselves (and the world) of i18n in
2.6 when there is practically nothing to do to integrate it?

Florent

> On Friday 13 September 2002 09:04 am, Florent Guillaume wrote:
> > I'm aware that this probably is going to get shot down, but I feel it i=
s
> > important:
> >=20
> > I'd like to propose including the _current_ 2.7 TAL+ZPT i18n code into
> > 2.6 right now (before the 2.6 beta), with the following changes:
> >=20
> >  - do not provide any translation service by default and leave that to
> >    third party products for now,
> >=20
> >  - provide a very simple framework (=E0 la a simple
> >    registerTranslationService) for third party products to plug in thei=
r
> >    translation service.
> >=20
> > The rationale for that proposal is:
> >=20
> >  - the code in 2.7 is functional enough (I'm using it in a manner
> >    described above) and implements most of the spec,
> >=20
> >  - there is (and there has been for a long time) a _huge_ need for i18n
> >    in core Zope, why wait when we have something that works,
> >=20
> >  - it doesn't impact people not using i18n tags at all,
> >=20
> >  - people using i18n tags but without an external translation service
> >    wouldn't see any change from current 2.6.
> >=20
> > Risks:
> >=20
> >  - speed hit in the TAL code itself (negligible I believe)
> >=20
> >  - bugs in the current i18n code
> >=20
> > I'm volunteering to do the small code integration needed during the
> > weekend on a branch off Zope-2_6-branch.

--=20
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com