django TemplateSyntaxError Invalid block tag: 'trans' -
after running runserver
command following error:
templatesyntaxerror @ /questions/ invalid block tag: 'trans'
does know what's reason?
this template syntax:
{% extends "two_column_body.html" %} {# template split several blocks included here blocks within directory templates/main_page relative skin directory there no html markup in file #} <!-- questions.html --> {% block forejs %} {% include "main_page/custom_head_javascript.html" %} {% endblock %} {% block title %}{% spaceless %}{% trans %}questions{% endtrans %}{% endspaceless %}{% endblock %} {% block content %} {% include "main_page/tab_bar.html" %} {% include "main_page/headline.html" %} {# ==== begin: main_page/content.html === #} <div id="question-list"> {% include "main_page/questions_loop.html" %} </div> {# ==== end: main_page/content.html === #} {% include "main_page/paginator.html" %} {% endblock %} {% block sidebar %} {% include "main_page/sidebar.html" %} {% endblock %} {% block endjs %} <script type="text/javascript"> {# cant cache #} askbot['settings']['showsortbyrelevance'] = {{ show_sort_by_relevance|as_js_bool }}; askbot['messages']['questionsingular'] = '{{ settings.words_question_singular|escapejs }}'; askbot['messages']['answersingular'] = '{{ settings.words_answer_singular|escapejs }}'; askbot['messages']['acceptownanswer'] = '{{ settings.words_accept_or_unaccept_own_answer|escapejs }}'; askbot['messages']['followquestions'] = '{{ settings.words_follow_questions|escapejs }}'; </script> {% include "main_page/javascript.html" %} {% include "main_page/custom_javascript.html" %} {% endblock %} <!-- end questions.html -->
{% trans %}questions{% endtrans %}
not correct format.
{% load i18n %}
should @ top of template, or extended template using translations.
you can use {% trans "questions." %}
if you're going use blocks, need in format below:
{% blocktrans %}{{ value2translate }}{% endblocktrans %}
more info here.
Comments
Post a Comment