On Mon, Mar 14, 2011 at 1:27 PM, hassan <hsn.zam...@gmail.com> wrote: > take a look at > http://docs.djangoproject.com/en/1.2/topics/i18n/internationalization/ > it is clear, > but for short: > > 1 - in .py files: > from django.utils.translation import ugettext as _ > and mark each text you want to traslate like this _("My string") > > 2 - in .html files: > {% load i18n %} > and mark with {% trans "My string" %} >
Or: {{ _("foo") }} You'll need to use this syntax to do things like filters: {{ _("foo")|linebreaksbr }} Or: {% blocktrans with foo as bar %}Some string with a {{ bar }} placeholder{% endblocktrans %} Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.