Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread Łukasz Rekucki
Hi everyone, First I'd like to say I got bitten by this in the past. What worries me the most in the original report is the TEMPLATE_DEBUG part. IMHO, this should fail loudly regardless of any debug settings. As for other stuff: On 22 January 2014 18:34, Ramiro Morales wrote: > I think you are

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread Ramiro Morales
On Wed, Jan 22, 2014 at 1:12 PM, Henrique Romano wrote: > > That was just an example, ugettext_* returns a functional.proxy, which > doesn't try to render the string when you print it on the screen, but if you > try to do it you will see the same result. You are right. On Wed, Jan 22, 2014 at 1:

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread Shai Berger
On Wednesday 22 January 2014 18:58:26 Henrique Romano wrote: > On Wed, Jan 22, 2014 at 2:38 PM, Shai Berger wrote: > > I don't think Django should take responsibility for a 3rd-party package > > which > > decides that some part of a setting should be translatable whether the > > user said so or no

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread Henrique Romano
On Wed, Jan 22, 2014 at 2:38 PM, Shai Berger wrote: > I don't think Django should take responsibility for a 3rd-party package > which > decides that some part of a setting should be translatable whether the user > said so or not. > > You might want to take this up with django-cms. Not exactly t

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread Henrique Romano
On Wed, Jan 22, 2014 at 12:43 PM, Ramiro Morales wrote: > You aren't telling us all the story. there are many missing parts in your > description of the issue you are finding so far so I don't think it's right > to jump straight to the "As per the documentation, it is not clear that > you _must_

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread Shai Berger
On Wednesday 22 January 2014 18:29:18 Henrique Romano wrote: > On Wed, Jan 22, 2014 at 2:16 PM, Shai Berger wrote: > > Wait -- so the real context (which, as Ramiro noted, you left out) is > > > > # settings.py > > > > LANGUAGES = (('pt_BR', _("Português")),) > > > > Is it? Or is it > > > > LA

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread Henrique Romano
On Wed, Jan 22, 2014 at 2:16 PM, Shai Berger wrote: > > Wait -- so the real context (which, as Ramiro noted, you left out) is > > # settings.py > > LANGUAGES = (('pt_BR', _("Português")),) > > Is it? Or is it > > LANGUAGES = (('pt_BR', "Português"),) > > If it is the former, then this is a generic

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread Shai Berger
On Wednesday 22 January 2014 18:01:14 Henrique Romano wrote: > On Wed, Jan 22, 2014 at 12:39 PM, Shai Berger 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 untran

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread Henrique Romano
On Wed, Jan 22, 2014 at 12:39 PM, Shai Berger 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

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread gilberto dos santos alves
yes i will try with django 1.6. 2014/1/22 Henrique Romano > On Wed, Jan 22, 2014 at 11:38 AM, gilberto dos santos alves < > gsa...@gmail.com> wrote: > >> please look details about on [1]. if you put >> >> # -*- coding: utf-8 -*- on sources and config files for django your string >> "português

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread Ramiro Morales
On Wed, Jan 22, 2014 at 10:59 AM, Henrique Romano wrote: > On Wed, Jan 22, 2014 at 11:38 AM, gilberto dos santos alves < > gsa...@gmail.com> wrote: > >> please look details about on [1]. if you put >> >> # -*- coding: utf-8 -*- on sources and config files for django your string >> "português" wi

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread Shai Berger
On Wednesday 22 January 2014 15:59:23 Henrique Romano wrote: > On Wed, Jan 22, 2014 at 11:38 AM, gilberto dos santos alves < > > gsa...@gmail.com> wrote: > > please look details about on [1]. if you put > > > > # -*- coding: utf-8 -*- on sources and config files for django your > > string "portu

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread Henrique Romano
On Wed, Jan 22, 2014 at 11:38 AM, gilberto dos santos alves < gsa...@gmail.com> wrote: > please look details about on [1]. if you put > > # -*- coding: utf-8 -*- on sources and config files for django your string > "português" will be automatically handled. > > Can you just try what I reported?

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread gilberto dos santos alves
please look details about on [1]. if you put # -*- coding: utf-8 -*- on sources and config files for django your string "português" will be automatically handled. regards. [1] http://docs.python.org/2/howto/unicode.html 2014/1/22 Henrique Romano > Hi, > > On Wed, Jan 22, 2014 at 12:37 AM,

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-22 Thread Henrique Romano
Hi, On Wed, Jan 22, 2014 at 12:37 AM, gilberto dos santos alves < gsa...@gmail.com> wrote: > please see that it is python directive not django. for all sources it is a > good practive for all we that use pt-br utf-8 explicit this on second line > of file python code > > # -*- coding: utf-8 -*- >

Re: Enforce the use of a unicode string in settings.LANGUAGES

2014-01-21 Thread gilberto dos santos alves
please see that it is python directive not django. for all sources it is a good practive for all we that use pt-br utf-8 explicit this on second line of file python code # -*- coding: utf-8 -*- regards! 2014/1/21 Henrique Romano > Hi, > > As per the documentation[1], it is not clear that yo

Enforce the use of a unicode string in settings.LANGUAGES

2014-01-21 Thread Henrique Romano
Hi, As per the documentation[1], it is not clear that you _must_ use a unicode string for the language name. If you don't use an unicode string, the following can happen: >>> from django.utils.translation import ugettext >>> ugettext("Português") Traceback (most recent call last): ... UnicodeDec