On Thu, Aug 12, 2010 at 03:07, kostia <kostya.demc...@gmail.com> wrote:
>
> Great. It somehow got working.
>
> I have the next code in the template:
> {% blocktrans with form_type|capfirst as task %}{{ task }} project{%
> endblocktrans %}
>
> Rosetta shows me an error in the left window:
> %(task)s project
>
> And when I try to compilemessages, terminal also shows an error:
> [r...@baikal projector]# python manage.py compilemessages
> processing file django.po in /home/kostia/Documents/Django/projector/
> locale/ru/LC_MESSAGES
> /home/kostia/Documents/Django/projector/locale/ru/LC_MESSAGES/
> django.po:400: a format specification for argument 'task' doesn't
> exist in 'msgstr'
> msgfmt: found 1 fatal error
> processing file django.po in /home/kostia/Documents/Django/projector/
> locale/uk/LC_MESSAGES
> /home/kostia/Documents/Django/projector/locale/uk/LC_MESSAGES/
> django.po:397: a format specification for argument 'task' doesn't
> exist in 'msgstr'
> msgfmt: found 1 fatal error
>
> Any suggestion?

Yep. When you see something like %( word-in-here )s  within the po
file, you are reaquired to keep the %()s - it means that the
"word-in-here" is a variable type string - which is the "format
specification" referred to in the error.
The best example of why this is useful is the date field. Say you have
the sentence:

The date today is 2010/08/12.

The date field is most likely a variable, not set in stone, hence the
format specification. The position of the date field in any particular
language may be different - it may come first or last or in the
middle. Finally, date field syntax are usually set by the locale
already and need to be adhered to in case the user changes it on a
computer by computer basis. In Australia, we use dd/mm/yyyy, the
American's use mm/dd/yyyy etc.

Anyway, put the %()s around the relevant word in the msgstr field, and
you should be set to go. I'd help but my Russian and Ukranian aren't
what they used to be :)
cheers
L.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.

Reply via email to