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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
jimt's avatar
63
jimt
asked 12 years ago

Comments

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!

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 12 years ago, updated 12 years ago
link

Comments

see more comments