def translate(self, lingua=None): try: set_lang(lingua) except web.core.i18n.LanguageError: return _("Invalid language selection.") return _("I now speak %(lingua)s.") % dict(lingua=lingua)
def index(self): return _('Hello world!')
def hello(self, name): return _("Hello, %(name)s!") % dict(name=name)