Re: Translation of object.attribute in template

2008-10-01 Thread V
I am not sure, but the lazy_ugettext thingy isn't exactly for this? "Use the function django.utils.translation.ugettext_lazy() to translate strings lazily -- when the value is accessed rather than when the ugettext_lazy() function is called." from

Re: Translation of object.attribute in template

2008-09-30 Thread Gerard Petersen
Carl, You can hold the brain on this one. I think I found out a solution. Probably similar to yours except using the states as keys. i18nstates = { 'created': _('Created'), 'quoted': _('Quoted'), 'cancelled': _('Cancelled'), 'ordered': _('Ordered'),

Re: Translation of object.attribute in template

2008-09-30 Thread Carl Meyer
On Sep 30, 3:29 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote: > You lost me. You mean make the states numerical and in the array related its > (numeric) keys to the, then translatable, 'words'? > > If so, the problem would be that the ease of use in coding would stop to > exist. The

Re: Translation of object.attribute in template

2008-09-30 Thread Gerard Petersen
Carl, You lost me. You mean make the states numerical and in the array related its (numeric) keys to the, then translatable, 'words'? If so, the problem would be that the ease of use in coding would stop to exist. The statemachine dynamically creates methods so you can use stuff like

Re: Translation of object.attribute in template

2008-09-30 Thread Carl Meyer
On Sep 30, 2:58 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote: > It is indeed stored, I'm using a state machine > (http://www.djangosnippets.org/snippets/737/). Setting this up multilingual > could result in unusable orders states, when users change their locale during > the state/transition

Re: Translation of object.attribute in template

2008-09-30 Thread Gerard Petersen
Kenneth, It is indeed stored, I'm using a state machine (http://www.djangosnippets.org/snippets/737/). Setting this up multilingual could result in unusable orders states, when users change their locale during the state/transition of an order. The tricky thing is that the states (used for

Re: Translation of object.attribute in template

2008-09-30 Thread Kenneth Gonsalves
On Tuesday 30 September 2008 10:40:15 am Gerard Petersen wrote: > #~ msgid "quoted" > #~ msgstr "jaja" > > It's in the template like this "{% trans order.state %}" so it's not picked > up by the makemessages command. Then another option is putting the > translation in the view, and manipulate it

Translation of object.attribute in template

2008-09-30 Thread Gerard Petersen
Hi all, I've been trying to workout a solution on the following: I want to show the translation of a string stored in the database in a template preferably with the use of "|capfirst" .. yeah yeah I know .. ;-) The translatable: order.state = 'billed' .. The term 'billed' is what needs to be