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 > > {% modal

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), > 'modal_questio

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
ONFIRM' %} ... 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, op

Re: Tutorial03: question about efficiency

2008-01-22 Thread opium
On Tuesday 22 January 2008 16:16:34 code_berzerker wrote: > theres line of code in tutorial: > > Poll.objects.all().order_by('-pub_date')[:5] > > this gives 5 Poll objects. I wonder if this is efficient way of > getting them? Does django get all rows first and then sort it and then > slice it to g