On Wed, Jan 22, 2014 at 12:39 PM, Shai Berger <s...@platonix.com> wrote:

>
> This has nothing to do with the LANGUAGES setting, or the string being a
> language name. it just so happens that ugettext tries to return unicode,
> and
> so for an untranslated string s it returns unicode(s). You can get the same
> error by writing
>
>         unicode("Português")
>

Correct.


> You should make sure that every string you pass to unicode(), directly or
> indirectly, is either a unicode object or an ASCII-only string (except in
> cases where you also pass the encoding); but that is general Python, not
> Django-specific.
>

The point is that I didn't know I had to pass an unicode string, I didn't
even know about the internals (of django-cms or django, I don't remember)
where the language name is being translated and therefore an unicode string
was necessary.  That's what I'm suggesting here, to make it explicit that
the language name string must be a unicode string.

-- 
Henrique Romano

In the face of ambiguity, refuse the temptation to guess.
    -- Tim Peters

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CA%2BEHud%2BVhKELjNt-TL1zL5smiszXTMe5LGQ2TFODJWC9Efe%3Dpw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to