On 5/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> What I do is the following. According to the docs I store the key
> 'locale' in the session (requiring a cookie on the client. Is there a
> way to use urls like en/... de/... fr/... with the way turbogears maps
> urls?). I also turn on i18n.runTemplateFilter, so constant strings in
> my templates get translated.

Using sessions to store something like 'locale' doesn't seem like a
good idea. (I generally avoid sessions as much as is humanly
possible...)

You could put sessions in a URL by defining a default method. It would
like somewhat similar to restful resource:

http://www.cherrypy.org/wiki/RestfulResource

> <----------------- SNIP ----------------->
> 29/Apr/2006:11:04:51 HTTP INFO Page handler: <bound method
> News.teilnehmen of <broenner.controllers.News object at 0x40bc
> 3aec>>
> Traceback (most recent call last):
>   File
> "/usr/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cphttptools.py",
> line 106, in _run
>     self.main()
>   File
> "/usr/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cphttptools.py",
> line 255, in main
>     body = page_handler(*virtual_path, **self.params)
>   File "<string>", line 3, in teilnehmen
>   File "/home/igor/turbogears/0.9a4/turbogears/controllers.py", line
> 211, in expose
>     output = database.run_with_transaction(expose._expose,func, accept,
> allow_json, allow_json_from_config,*args, **kw)
>   File "/home/igor/turbogears/0.9a4/turbogears/database.py", line 216,
> in run_with_transaction
>     retval = func(*args, **kw)
>   File "<string>", line 5, in _expose
>   File "/home/igor/turbogears/0.9a4/turbogears/controllers.py", line
> 232, in <lambda>
>     expose._expose.when(rule)(lambda _func, accept, allow_json,
> allow_json_from_config,*args,**kw: _execute_func(
>   File "/home/igor/turbogears/0.9a4/turbogears/controllers.py", line
> 265, in _execute_func
>     return _process_output(output, template, format, content_type,
> mapping, fragment)
>   File "/home/igor/turbogears/0.9a4/turbogears/controllers.py", line
> 56, in _process_output
>     mapping=mapping, content_type=content_type,fragment=fragment)
>   File "/home/igor/turbogears/0.9a4/turbogears/view/base.py", line 131,
> in render
>     return engine.render(**kw)
>   File
> "/usr/lib/python2.4/site-packages/TurboKid-0.9.3-py2.4.egg/turbokid/kidsupport.py",
> line 154, in render
>     return t.serialize(encoding=self.defaultencoding, output=format,
> fragment=fragment)
>   File
> "/usr/lib/python2.4/site-packages/kid-0.9-py2.4.egg/kid/__init__.py",
> line 236, in serialize
>     return serializer.serialize(self, encoding, fragment)
>   File
> "/usr/lib/python2.4/site-packages/kid-0.9-py2.4.egg/kid/serialization.py",
> line 51, in serialize
>     text = list(self.generate(stream, encoding, fragment))
>   File
> "/usr/lib/python2.4/site-packages/kid-0.9-py2.4.egg/kid/serialization.py",
> line 327, in generate
>     for ev, item in self.apply_filters(stream):
>   File
> "/usr/lib/python2.4/site-packages/kid-0.9-py2.4.egg/kid/serialization.py",
> line 84, in balancing_filter
>     for ev, item in stream:
>   File
> "/usr/lib/python2.4/site-packages/kid-0.9-py2.4.egg/kid/pull.py", line
> 206, in _coalesce
>     for ev, item in stream:
>   File "/home/igor/turbogears/0.9a4/turbogears/i18n/kidutils.py", line
> 60, in i18n_filter
> ....
> ....
>
>  File "/home/igor/turbogears/0.9a4/turbogears/i18n/kidutils.py", line
> 60, in i18n_filter
>     for ev, item in stream:
>   File "/home/igor/turbogears/0.9a4/turbogears/i18n/kidutils.py", line
> 57, in i18n_filter
>     lang_attr = turbogears.config.get("i18n.templateLocaleAttribute",
> "lang")
>   File "/home/igor/turbogears/0.9a4/turbogears/config.py", line 51, in
> get
>     return config.get(key, default_value, return_section, path)
>   File
> "/usr/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/config.py",
> line 115, in get
>     path = cherrypy.request.object_path
> RuntimeError: maximum recursion depth exceeded
> <------------------SNAP---------------->

Was the recursion in the "..." part of the traceback? it's looping
through the i18n_filter repeatedly? Does it get back to Kid, or is it
somehow just stuck in i18n_filter? It doesn't *look* like it should
get stuck in there.

> I tried moving to postgres, storing sessions in Ram or Files, using
> implicit or explicit locking and upgrading cherrypy and sqlobject to
> their latest version. I also tried the trunk as of today to no avail.

I'd recommend sticking with the 1.0 branch and the sqlobject version
that we're using in release (though I can certainly understand the
desire to try things out to see if the problem is fixed...)

Kevin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk
-~----------~----~----~----~------~----~------~--~---

Reply via email to