Ask Your Question
1

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

asked 2012-05-17 17:28:29 -0500

jimt gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-05-17 17:41:30 -0500

Evgeny gravatar image

updated 2012-05-17 17:42:05 -0500

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!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-05-17 17:28:29 -0500

Seen: 82 times

Last updated: May 17 '12