#2255: Language support in session lacking
------------------------+---------------------------------------------------
 Reporter:  aigarius    |       Owner:        
     Type:  defect      |      Status:  new   
 Priority:  normal      |   Milestone:  2.0rc1
Component:  TurboGears  |     Version:  2.0b6 
 Severity:  normal      |    Keywords:  i18n  
------------------------+---------------------------------------------------
 The i18n support in TG2 is good, but one simple thing is lacking - saving
 language in a session. When we have an i18n'ed application and we have
 user sessions, then we should be able to allow users to change their
 desired language regardless of their browser setting. There is a
 
[http://wiki.pylonshq.com/display/pylonsdocs/Internationalization+and+Localization
 Pylons document] about that, but the example provided does not work,
 because the __before__ method of the RootController is not being executed.

 It would be very helpful if TG2 could look at the session and set a
 language from session's 'lang' parameter if such exists, overriding the
 browser accepted languages. This could be done in
 tg/controllers.py:setup_i18n() (assuming it gets called for every
 request).

 After that we could switch languages by calling:
 pylons.session['lang'] = ru
 pylons.session.save()
 pylons.i18n.set_lang('ru')

 As an alternatve a new function tg.set_lang() could be provided that would
 do the above to wrap it all up neatly.

-- 
Ticket URL: <http://trac.turbogears.org/ticket/2255>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to