views:

37

answers:

1

Hello,

I am using django i18n and I have succeeded in translating strings and variables in my html tempate with {% trans "some string" %}.

But I want to translate a whole page content and not only a few strings, and my question: what is the best way to do this.

I have tried with {% blocktrans %} html content {% endblocktrans %}, but this is a very inefficient way, especially when I want to manage the content later.

I thought about something like:

<form action="/i18n/setlang/" method="post">
<input name="next" type="hidden" value="/next/page/" />
<select name="language">
{% for lang in LANGUAGES %}
<option value="{{ lang.0 }}">{{ lang.1 }}</option>
{% endfor %}
</select>
<input type="submit" value="Go" />
</form>

where you could refer the value to a copy of the translated content. But I do not want to have two html pages for the same, and I am currently using "django-localeurl"

I have also heard of "django-rosetta"??!!

Thank you for any help, best regards

A: 

If you really want translations for dynamic (CMS-like) text, you should take a look at django-multilangual, the basic i18n is more fitted for short static strings, not for long dynamic ones.

KillianDS
Thank you for your feedback. In my special case I have long static content to translate (disclaimer). So I think there is no ohter way than to translate it just once in the appropiate django.po file.
Saeed