First time here? Check out the FAQ!
1

What is the correct use of template substitution within translate section?

The askbot/skins/default/templates/faq_static.html file contains:

{% trans %}Please <a href='%(ask_question_url)s'>ask</a> your question, help make our community better!{% endtrans %}

which is rendered with a link of: http://askbot.example.com/faq/%(ask_question_url)s. I suspect it should be href="{{ ask_question_url }}" but I am not certain if that will work with the translation mechanism.

jimt's avatar
63
jimt
asked 2012-05-17 17:28:29 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

Yes, that is wrong, the error happened when the strings were moved from django.po file to the templates.

It is better to use url template tags {% url ask %} and get rid of the unnecessary context variable in the template and in the view askbot.views.meta.faq. There are actually two urls like that.

If you fix that and make a pull request I will merge the patch. Thanks!

Evgeny's avatar
13.2k
Evgeny
answered 2012-05-17 17:41:30 -0500, updated 2012-05-17 17:42:05 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments