[Zope-dev] Zope Exceptions and translation

Dirk Datzert Dirk.Datzert@rasselstein-hoesch.de
Mon, 03 Dec 2001 21:52:43 +0100


Hi,

we at ZBabel have to same problems with translating the Exceptions of Products.
And my personal best solution is to use the translate-Method direct in the
Python-Code which raises the Exceptions. That works for every text directly in
the Python Code.

Regards
Dirk

Andre Schubert schrieb:

> Hi,
>
> yes it is a big job, but i started at all form-based exceptions,
> because the members of our websites can manage many things over
> web-forms, thats why i tried to patch
> all HTTPResponse-exceptions with writing a product that patches the
> correspondend functions,
> further i patched Converters.py so that it returns german error_values.
> Thats the work i have done and it seems to work for me.
> All i want is a Product which catches as many exceptions as possible and
> translate them into, for me, german.
> I also thought that i can design the product as like as zzlocale, thats
> its easy to translate into other languages.
>
> I dont want to hack the sources, i want a Product but its hard to
> program all the exceptions.
>
> thanks as
>
> seb bacon schrieb:
> >
> > You're certainly right, but it would be a big job.  In fact I recently
> > started a proposal on the subject (bare bones).  Please add to it!
> > Especially the requirement for i18n.
> >
> >   http://dev.zope.org/Wikis/DevSite/Proposals/ClassBasedExceptions
>
> What and how should it add???
>
> >
> > seb
> >
> > * Andre Schubert <andre.schubert@geyer.kabeljournal.de> [011203 15:10]:
> > > Hi all,
> > >
> > > I'am looking for several products to translate zope-site into german.
> > > I have found ZBabel and it works very fine for normal websites.
> > > It always works fine in the standard_error_message if there is an
> > > error_value and an error_type.
> > > But it doesnt work if i get an string exception, because the error_value
> > > is an complete html-site.
> > > Therefore i tryed to patch some Exceptions in HTTPResponse to raise an
> > > class-Exception and a short string
> > > as error_value.
> > > The problem i see is that all exceptions in zope are raised in many
> > > defferent places and thats very difficult
> > > to patch them or to make them translation-able.
> > > I think it is a good way to change all string-exceptions like these in
> > > HTTPResponse to class-exceptions and the error_value
> > > to a normal description. With these changes the standard_error_message
> > > could be raised and there is an ability to
> > > translate the error_value.
> > > Do i think in the right way or did i missing any facts
> > >
> > > thanks as
> > >
> > > _______________________________________________
> > > Zope-Dev maillist  -  Zope-Dev@zope.org
> > > http://lists.zope.org/mailman/listinfo/zope-dev
> > > **  No cross posts or HTML encoding!  **
> > > (Related lists -
> > >  http://lists.zope.org/mailman/listinfo/zope-announce
> > >  http://lists.zope.org/mailman/listinfo/zope )
> >
> > --
> >
> >    [] j a m k i t
> >
> >         seb bacon
> > T:  020 7749 7218
> > F:  020 7739 8683
> > M:  07968 301 336
> > W: www.jamkit.com
> >
> > _______________________________________________
> > Zope-Dev maillist  -  Zope-Dev@zope.org
> > http://lists.zope.org/mailman/listinfo/zope-dev
> > **  No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope )
>
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )