List Info

Thread: Choices cannot be marked for translation?




Choices cannot be marked for translation?
country flaguser name
United States
2007-08-28 06:27:01
hi,

when i upgraded to the latest svn head, I found that all the
places  
in admin that had drop downs for choices were blank. I had
always  
marked my choices for translation like so:

article_type = (
("NW", _("News")),
("FT",_("Features")),
)

now, this doesnt work - when I remove the _(), then the
choices  
appear. How do I then mark them for translation?

-- 

regards
kg
http://lawgon.livejourn
al.com
http://nrcfosshelpline
.in/web/



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Choices cannot be marked for translation?
country flaguser name
Spain
2007-08-28 11:25:50
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kenneth Gonsalves escribió:
> hi,
> 
> when i upgraded to the latest svn head, I found that
all the places  
> in admin that had drop downs for choices were blank. I
had always  
> marked my choices for translation like so:
> 
> article_type = (
> ("NW", _("News")),
> ("FT",_("Features")),
> )
> 
> now, this doesnt work - when I remove the _(), then the
choices  
> appear. How do I then mark them for translation?
> 

Make sure to use gettext_lazy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


iD8DBQFG1EyOSyMaQ2t7ZwcRAgMiAKCXgHMMs+GgGxhTb5MDrXvPE/omfwCc
CL62
en0reRc7vwT/s4WZuRnA8Ns=
=dHi8
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Choices cannot be marked for translation?
country flaguser name
United States
2007-08-28 20:51:41

On 28-Aug-07, at 9:55 PM, Chris Hoeppner wrote:

>> when i upgraded to the latest svn head, I found
that all the places
>> in admin that had drop downs for choices were
blank. I had always
>> marked my choices for translation like so:
>>
>> article_type = (
>> ("NW", _("News")),
>> ("FT",_("Features")),
>> )
>>
>> now, this doesnt work - when I remove the _(), then
the choices
>> appear. How do I then mark them for translation?
>>
>
> Make sure to use gettext_lazy

i *am* using: from django.utils.translation import
gettext_lazy as _

-- 

regards
kg
http://lawgon.livejourn
al.com
http://nrcfosshelpline
.in/web/



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Choices cannot be marked for translation?
user name
2007-08-29 03:54:16
On Wed, Aug 29, Kenneth Gonsalves wrote:

> 
> 
> On 28-Aug-07, at 9:55 PM, Chris Hoeppner wrote:
> 
> >> when i upgraded to the latest svn head, I
found that all the places
> >> in admin that had drop downs for choices were
blank. I had always
> >> marked my choices for translation like so:
> >>
> >> article_type = (
> >> ("NW", _("News")),
> >> ("FT",_("Features")),
> >> )
> >>
> >> now, this doesnt work - when I remove the _(),
then the choices
> >> appear. How do I then mark them for
translation?
> >>
> >
> > Make sure to use gettext_lazy
> 
> i *am* using: from django.utils.translation import
gettext_lazy as _

Ha! How should we know?

Does it help to use ugettext_lazy instead?

Michael


-- 
noris network AG - Deutschherrnstraße 15-19 - D-90429
Nürnberg -
Tel +49-911-9352-0 - Fax +49-911-9352-100
http://www.noris.de - The
IT-Outsourcing Company
 
Vorstand: Ingo Kraupa (Vorsitzender), Joachim Astel,
Hansjochen Klenk - 
Vorsitzender des Aufsichtsrats: Stefan Schnabel - AG
Nürnberg HRB 17689

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Choices cannot be marked for translation?
country flaguser name
United States
2007-08-29 04:17:57

On 29-Aug-07, at 2:24 PM, Michael Radziej wrote:

>>>> now, this doesnt work - when I remove the
_(), then the choices
>>>> appear. How do I then mark them for
translation?
>>>>
>>>
>>> Make sure to use gettext_lazy
>>
>> i *am* using: from django.utils.translation import
gettext_lazy as _
>
> Ha! How should we know?
>
> Does it help to use ugettext_lazy instead?

doesnt work - i just marked one string, the marked string
didnt  
appear, the other two did.

-- 

regards
kg
http://lawgon.livejourn
al.com
http://nrcfosshelpline
.in/web/



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Choices cannot be marked for translation?
user name
2007-08-29 04:21:51
On Wed, Aug 29, Kenneth Gonsalves wrote:

> 
> 
> On 29-Aug-07, at 2:24 PM, Michael Radziej wrote:
> 
> >>>> now, this doesnt work - when I remove
the _(), then the choices
> >>>> appear. How do I then mark them for
translation?
> >>>>
> >>>
> >>> Make sure to use gettext_lazy
> >>
> >> i *am* using: from django.utils.translation
import gettext_lazy as _
> >
> > Ha! How should we know?
> >
> > Does it help to use ugettext_lazy instead?
> 
> doesnt work - i just marked one string, the marked
string didnt  
> appear, the other two did.

Well, sorry, then I'm personally running out of ideas. But
this looks really
weird.

Michael

-- 
noris network AG - Deutschherrnstraße 15-19 - D-90429
Nürnberg -
Tel +49-911-9352-0 - Fax +49-911-9352-100
http://www.noris.de - The
IT-Outsourcing Company
 
Vorstand: Ingo Kraupa (Vorsitzender), Joachim Astel,
Hansjochen Klenk - 
Vorsitzender des Aufsichtsrats: Stefan Schnabel - AG
Nürnberg HRB 17689

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Choices cannot be marked for translation?
country flaguser name
Poland
2007-08-29 04:23:44
Kenneth Gonsalves napisa³(a):

>>>>> now, this doesnt work - when I remove
the _(), then the choices
>>>>> appear. How do I then mark them for
translation?
>>>>>
>>>> Make sure to use gettext_lazy
>>> i *am* using: from django.utils.translation
import gettext_lazy as _
>> Ha! How should we know?
>>
>> Does it help to use ugettext_lazy instead?
> 
> doesnt work - i just marked one string, the marked
string didnt  
> appear, the other two did.

The next testing option is to try with non-lazy version.

-- 
Jarek Zgoda
Skype: jzgoda | GTalk: zgodajabber.aster.pl | voice:
+48228430101

"We read Knuth so you don't have to." (Tim
Peters)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Choices cannot be marked for translation?
country flaguser name
United States
2007-08-29 04:26:41

On 29-Aug-07, at 2:51 PM, Michael Radziej wrote:

>> doesnt work - i just marked one string, the marked
string didnt
>> appear, the other two did.
>
> Well, sorry, then I'm personally running out of ideas.
But this  
> looks really
> weird.

i filed a bug report

-- 

regards
kg
http://lawgon.livejourn
al.com
http://nrcfosshelpline
.in/web/



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Choices cannot be marked for translation?
country flaguser name
United States
2007-08-29 04:34:22

On 29-Aug-07, at 2:53 PM, Jarek Zgoda wrote:

>>>>>> now, this doesnt work - when I
remove the _(), then the choices
>>>>>> appear. How do I then mark them for
translation?
>>>>>>
>>>>> Make sure to use gettext_lazy
>>>> i *am* using: from django.utils.translation
import gettext_lazy  
>>>> as _
>>> Ha! How should we know?
>>>
>>> Does it help to use ugettext_lazy instead?
>>
>> doesnt work - i just marked one string, the marked
string didnt
>> appear, the other two did.
>
> The next testing option is to try with non-lazy
version.

that works! import gettext as _

-- 

regards
kg
http://lawgon.livejourn
al.com
http://nrcfosshelpline
.in/web/



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Choices cannot be marked for translation?
country flaguser name
Poland
2007-08-29 06:01:22
Kenneth Gonsalves napisa³(a):

>>>>>>> now, this doesnt work - when I
remove the _(), then the choices
>>>>>>> appear. How do I then mark them
for translation?
>>>>>>>
>>>>>> Make sure to use gettext_lazy
>>>>> i *am* using: from
django.utils.translation import gettext_lazy  
>>>>> as _
>>>> Ha! How should we know?
>>>>
>>>> Does it help to use ugettext_lazy instead?
>>> doesnt work - i just marked one string, the
marked string didnt
>>> appear, the other two did.
>> The next testing option is to try with non-lazy
version.
> 
> that works! import gettext as _

And that's a real bug, I think.

Anyway, for future reference, keep in mind that lazily
translated
"strings" become real strings at access time.
Before that they are
function objects. That is, you cann't, for example, pickle
them - and in
consequence put in session because session data is pickled
before
saving. Laziness isn't always good. ;)

-- 
Jarek Zgoda
Skype: jzgoda | GTalk: zgodajabber.aster.pl | voice:
+48228430101

"We read Knuth so you don't have to." (Tim
Peters)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-10] [11-15]

about | contact  Other archives ( Real Estate discussion Medical topics )