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 jimt flag of New Zealand
53 1 7
http://WikiEducator.org/U...

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.

delete close flag offensive retag edit

1 Answer

Sort by » oldest newest most voted
1

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

Evgeny gravatar image Evgeny flag of Chile
11329 50 84 183
http://askbot.org/

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!

link publish delete flag offensive edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow

subscribe to rss feed

Stats

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

Seen: 34 times

Last updated: May 17 '12