Re: TemplateSyntaxError: VariableDoesNotExist
2009/9/24 Brian McKeever > > I would write a custom tag that wraps ugettext but checks for None. > > http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#writing-custom-template-filters > http://docs.djangoproject.com/en/dev/topics/i18n/#standard-translation > > On Sep 24, 10:14 am, Florian Schweikert > wrote: > > Hello, > > > > {% trans Pagetitle %} produces TemplateSyntaxError when there is no > > Pagetitle given, without translation django ignores it. > > Why i18n can't translate/ignore NoneType? I don't want to use if around > all > > this varibles. Is there any more confortable way? > > > > greetings, > > Florian > > > That's a good idea, thanks for the tip. --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: TemplateSyntaxError: VariableDoesNotExist
I would write a custom tag that wraps ugettext but checks for None. http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#writing-custom-template-filters http://docs.djangoproject.com/en/dev/topics/i18n/#standard-translation On Sep 24, 10:14 am, Florian Schweikert wrote: > Hello, > > {% trans Pagetitle %} produces TemplateSyntaxError when there is no > Pagetitle given, without translation django ignores it. > Why i18n can't translate/ignore NoneType? I don't want to use if around all > this varibles. Is there any more confortable way? > > greetings, > Florian --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
TemplateSyntaxError: VariableDoesNotExist
Hello, {% trans Pagetitle %} produces TemplateSyntaxError when there is no Pagetitle given, without translation django ignores it. Why i18n can't translate/ignore NoneType? I don't want to use if around all this varibles. Is there any more confortable way? greetings, Florian --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---