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 http://docs.djangoproject.com/en/dev/topics/i18n/#lazy-translation

and then you just define the possible options in your model with
ugettext_lazy

V


On Sep 30, 10:06 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote:
> 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'),
>         'billed': _('Billed'),
>         'paid': _('Paid')
>         }
>
> This way I can access the states as usual, and have the related translation 
> displayed.
>
> Regards,
>
> Gerard.
>
> Carl Meyer wrote:
> > 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 of an order.
>
> >> The tricky thing is that the states (used for control) also have a meaning 
> >> to the user displayed in the template. So I would want to translate them 
> >> at the last moment, and not store them as such.
>
> > Use a choices array with numerical keys and just translate the values
> > (which are never stored in the DB).
>
> --
> urls = { 'fun':  'www.zonderbroodje.nl',  'tech':  'www.gp-net.nl'}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to