﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13317	{% blocktrans %}: accessing attributes and general documentation concerning variables	Chris Morgan	nobody	"In the Django template system, it's documented about using `{% blocktrans %}` with local variables; it says that:

""To translate a template expression -- say, using template filters -- you need to bind the expression to a local variable for use within the translation block:""

This caused me quite a bit of trouble as it didn't occur to me for a very long time that accessing attributes on a model object would qualify as a template expression.  This meant that for ages I was trying to work out why this caused a !KeyError:

{{{
{% blocktrans %}That will cost ${{ i.price }}{% endblocktrans %}
}}}

I think that it needs to be either specified in docs/topics/i18n/internationalization that this sort of a situation would need to be done like this:

{{{
{% blocktrans with i.price as price %}That will cost ${{ price }}{% endblocktrans %}
}}}

Or, better still, it should be fixed so that it works... but considering how gettext works this probably isn't reasonable. Currently though it only shows examples of filters and that made it so that the reason my code was breaking didn't occur to me.

Also the documentation of the ""count"" thing is very vague. It took me a while to work out (partly due to the fact that recognition ""count"" is missing from the Pygments lexer) that it is just using `count` instead of `with` or `and`, like the following. It could be considerably improved by spelling this out in so many words.

{{{
{% blocktrans with i.price as price count i.length as years %}That will cost ${{ price }} per year{% plural %}That will cost ${{ price }} per {{ years }} years{% endblocktrans %}
}}}"		closed	Documentation	dev		fixed	blocktrans variables attributes		Accepted	1	0	0	0	0	0
