YAY!!!
Thank you very much. Now this Boilerplate even supports Chinese.

http://appengine.protoboard.cl

- Rodrigo
@coto <http://twitter.com/coto>



On Mon, Apr 2, 2012 at 05:28, Simon Sapin <[email protected]> wrote:

> Le 02/04/2012 07:16, Rodrigo Augosto a écrit :
>
>  I have a lib/languages.py file only with a dict format e.g.:
>>
>> en = {}
>> en["farewell"] = "goddbye"
>> es = {}
>> es["farewell"] = "Adi&oacute;s"
>>
>> Also I have a lib/basehandler.py where I use language.py and this
>> basehandler has a Unicode literal (# -*- coding: utf-8 -*-)
>>
>> The problem is that when I render a template in Spanish (es), it has on
>> its html "Adi&amp;ocuate;s" and off course the text the the user see is
>> "Adi&oaucte;s" instead "Adiós"
>>
>> I tried to use on languages.py
>> es["farewell"] = "Adi&oacute;s"
>> or add Unicode literal (# -*- coding: utf-8 -*-) in this file, but
>> nothing work.
>>
>
> Hi,
>
> I looks like your templates (Jinja?) have auto-escaping enabled. When you
> pass them "Adi&oacute;s", they convert it to an HTML-safe representation so
> that end-users see the same as what you passed.
>
> Now, if you have a string that you know contains safe HTML, you can use
> the |safe Jinja filter to disable auto-escaping for that string.
>
> But what if, later, you want to use your translations in a non-HTML
> context? It is probably better to have non-HTML-encoded, real unicode
> strings in your languages.py file, and let the template escaping do its job.
>
> To make unicode literal strings on Python 2.x, either use the u prefix:
>
> es["farewell"] = u"Adiós"
>
> or add "from __future__ import unicode_literals" at the top of the file to
> make all strings in this file unicode. (Use the b"foo" for byte-strings.)
>
> Regards,
> --
> Simon Sapin
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "pocoo-libs" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to pocoo-libs+unsubscribe@**
> googlegroups.com <pocoo-libs%[email protected]>.
> For more options, visit this group at http://groups.google.com/**
> group/pocoo-libs?hl=en <http://groups.google.com/group/pocoo-libs?hl=en>.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pocoo-libs?hl=en.

Reply via email to