Monday, 15 February 2010

internationalization - viewing translations in django templates (e.g - making it work) -


I am trying to find a deggengo translation system, so I wrote a little test app. I made translation files and compiled them (* .po and * .mo), and now I am trying to render a template in a different language. I translate LANGUAGE_CODE into my settings / other language code, but the template still renders in English. No error has been given, I can not see another language which I am trying to do, even if I translated, Compiled and all these I have also used the get_current_language in the template: whatever I need, I have used DB to support.

  {% load i18n%} {% get_current_language LANGUAGE_CODE%} {% get_available_languages LANGUAGES%} {% is the current language of LANGUAGE_BIDI%} as {{LANGUAGE_CODE}}  

but I'm getting blank where the code should be visible. What am I missing? Thank you.

This is probably one of the two problems:

  1. Make sure you have the settings in django.core.context_processors.i18n . TEMPLATE_CONTEXT_PROCESSORS

  2. Ensure that you use <<>

If you are providing your template, then context_instance as RequestContext (request)

No comments:

Post a Comment