Search code examples
internationalizationweb2py

Web2py: where to set T.set_current_languages()


I'm trying to internationalise my app, and I want to set T.set_current_languages('en', 'en-en') as described in the docs. But it's unclear to me which file to place this in. Can I just stick it in e.g. db.py? Or at the top of default.py?


Solution

  • If you want the setting to apply to all requests, then put it in a model file (e.g., db.py, as you suggest). If you put it at the top of the default.py controller, it will apply only to requests made to the default controller.