Пример #1
0
    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)
Пример #2
0
 def index(self):
     return _('Hello world!')
Пример #3
0
 def hello(self, name):
     return _("Hello, %(name)s!") % dict(name=name)