I18NController

Notes

Notes to self:

Status

Examples

To set up a custom Locale middleware to use for all requests served by a simple WSGI handler:

   1 from django.middleware.locale import LocaleMiddleware
   2 from django.utils.translation.trans_real import DjangoTranslation
   3 
   4 class DjangoLocaleManager(DjangoTranslation):
   5 
   6     def get_current_locale(self):
   7         raise NotImplementedError
   8 
   9 class I18NController(BaseController):
  10 
  11     locale_manager = DjangoLocaleManager
  12     request_middlewares = (LocaleMiddleware, )
  13 
  14     def get_locale_manager(self):
  15         return getattr(self, 'locale_manager')

just another Wiki: BaseControllerAPI/I18NController (last edited 2010-06-18 01:44:30 by EtienneRobillard)