How do I escape a single quote in a Django template?

1,906 views
Skip to first unread message

jmDesktop

unread,
Apr 21, 2008, 2:29:09 PM4/21/08
to Django users
Hi, I'm trying to change the admin template from chapter 6 of
djangobook.com. How can I change the admin template from:

{% trans 'Django administration' %}

to

{% trans 'Bob's administration' %}

I can't put the apostrophe single quote in there. I tried \' and
&#39, but it did not work. Thank you for any help.

Rajesh Dhawan

unread,
Apr 21, 2008, 2:35:29 PM4/21/08
to Django users
Did you try double-quotes?

Kevin Monceaux

unread,
Apr 21, 2008, 2:42:56 PM4/21/08
to Django users
jmDesktop,

On Mon, 21 Apr 2008, jmDesktop wrote:

> {% trans 'Bob's administration' %}

One can find examples of using the trans template tag about 1/4 of the way
down the Internationalization documentation page:

http://www.DjangoProject.com/documentation/i18n/

For the above it looks like:

{% trans "Bob's administration" %}

or

{% blocktrans %}Bob's administration{% endblocktrans %}

might work.

Kevin
http://www.RawFedDogs.net
http://www.WacoAgilityGroup.org
Bruceville, TX

Si hoc legere scis nimium eruditionis habes.
Longum iter est per praecepta, breve et efficax per exempla!!!

Reply all
Reply to author
Forward
0 new messages