Hi,
Did you tried using the TranslationStringFactory instead?
from pyramid.i18n import TranslationStringFactory_ =
TranslationStringFactory('eventbroker')
...
error_notaicalfile = _("The given Address didn't return...")
request.localizer.translate(error_notaicalfile)
I use this method with lingua and it works perfectly...
Best regards,
Thierry
2015-03-30 9:27 GMT+02:00 Gerhard Schmidt <[email protected]>:
> Hi,
>
> i developing a pyramid application with i18n support. I've setup pyramid
> to use lingua and as far as I user i18n tag in chameleon templates
> pot-create extracting them correctly.
>
> But translation strings from python code is not extracted.
>
> I am following the documentation at
> http://docs.pylonsproject.org/docs/pyramid/en/latest/narr/i18n.html
>
>
> error_notaicalfile = TranslationString("The given Address didn't return
> a calendar file", domain='eventbroker')
>
> and in the view i use
>
> request.localizer.translate(error_notaicalfile)
>
> Am I doing something wrong.
>
> Regards
> Estartu
>
>
> --
> ---------------------------------------------------------------------------
> Gerhard Schmidt | http://www.augusta.de/~estartu |
> Fischbachweg 3 | | PGP Public Key
> 86856 Hiltenfingen | JabberID: [email protected] | on request
> Germany | |
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/pylons-discuss.
> For more options, visit https://groups.google.com/d/optout.
>
--
http://www.imagesdusport.com -- http://www.ztfy.org
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.