I initially thought about this approach but i seemed kind of hacked.

Any other sugestions?

Regards,

Luis

On Jan 21, 1:16 pm, opium <[EMAIL PROTECTED]> wrote:
> The problem is that _(variable) doesn't add strings to .pot
> You can solve this by custom adding strings to .pot, or by
> moving strings into function
>
> def some_fun(context, msg_id):
>  messages = {
>   'IMG_DEL_CONFIRM': {
>         'modal_name': name,
>         'modal_caption': _(caption),
>         'modal_question': _(question),
>         'modal_yesfunction': yesfunction,
>         'modal_nofunction': nofunction,
>     },
>   'SOME_OTHER_CONFIRM': {......}
>  }
>  return messages[msg_id]
>
> and in template
> {% some_fun 'IMG_DEL_CONFIRM' %}
>
> ... or something similar
>
> but I think must be better solution
>
> > Yes, if I use {%trans "string"%} in template it gets added to .pot
>
> > The problem is that _(variable) doesn't work, only _("string") works.
>
> > On Jan 21, 12:01 pm, opium <[EMAIL PROTECTED]> wrote:
> > > does same strings extracted by trans in templates?
>
> > > > Just tested, using
> > > > from django.utils.translation import ugettext as _
> > > > pybabel does not extract the strings.
>
> > > > any other ideias, please.
>
> > > > Luis
--~--~---------~--~----~------------~-------~--~----~
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