Re: Translate template tag parameters

2008-01-21 Thread [EMAIL PROTECTED]
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

Re: Translate template tag parameters

2008-01-21 Thread opium
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),

Re: Translate template tag parameters

2008-01-21 Thread [EMAIL PROTECTED]
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

Re: Translate template tag parameters

2008-01-21 Thread opium
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

Re: Translate template tag parameters

2008-01-21 Thread opium
sure. why not? > So should i do like this: > > def modalconfirm(context, name, caption, question, yesfunction, > nofunction=None): > """ > Shows a modal confirm dialog > """ > > return { > 'modal_name': name, > 'modal_caption': _(caption), >

Re: Translate template tag parameters

2008-01-21 Thread [EMAIL PROTECTED]
Just tested, using from django.utils.translation import ugettext as _ pybabel does not extract the strings. any other ideias, please. Luis On Jan 21, 10:30 am, opium <[EMAIL PROTECTED]> wrote: > sure. why not? > > > So should i do like this: > > > def modalconfirm(context, name, caption,

Re: Translate template tag parameters

2008-01-21 Thread opium
> > I've created a templatetag to show a AJAX confirm dialog with is used > like this: > > {% modalconfirm "delete_small_photo" "Delete" "Are you sure you want > to delete this user's small photo?" "delete_smallphoto" %} > > The strings should be translated, how can this be done since > > {%

Re: Translate template tag parameters

2008-01-21 Thread [EMAIL PROTECTED]
So should i do like this: def modalconfirm(context, name, caption, question, yesfunction, nofunction=None): """ Shows a modal confirm dialog """ return { 'modal_name': name, 'modal_caption': _(caption), 'modal_question': _(question),

Translate template tag parameters

2008-01-21 Thread [EMAIL PROTECTED]
Hello, I've created a templatetag to show a AJAX confirm dialog with is used like this: {% modalconfirm "delete_small_photo" "Delete" "Are you sure you want to delete this user's small photo?" "delete_smallphoto" %} The strings should be translated, how can this be done since {% modalconfirm