Hello,
I am using Django 1.2.5.
* template:
{% trans 'If you cancel queued construction, you will get 75% of resources
back' %}
* django-admin.py makemessages -l sk produces:
#: templates/core/buildings/construction.html:65
#, python-format
msgid "If you cancel queued construction, you will get 75% of resources
back"
msgstr ""
I open the .po file in poedit program and add translation "Zrušením budovy
v stavebnom rade sa ti vráti 75% surovín" what produces:
1375 #: templates/core/buildings/construction.html:65
1376 #, python-format
1377 msgid "If you cancel queued construction, you will get 75% of
resources back"
1378 msgstr "Zrušením budovy v stavebnom rade sa ti vráti 75% surovín"
And poedit (or django compilemessages) shows me an error
"...po:1378:format specification in 'msgid' nad 'msgstr' for argument a
are not the same". When I add 75%% in my translated string doesn't work
either, I need to manually edit the msgid string and change % for %%, so
it looks so:
1375 #: templates/core/buildings/construction.html:65
1376 #, python-format
1377 msgid "If you cancel queued construction, you will get 75%% of
resources back"
1378 msgstr "Zrušením budovy v stavebnom rade sa ti vráti 75%% surovín"
This will compile. But no translation occurs because it seems that {%
trans %} can not handle percent sign. Is it so or I am doing something
wrong?
I could split the string into two translation string like this:
{% trans 'If you cancel queued construction, you will get' %} 75% {% trans
'of resources back' %}
but this seems a little bit ugly. Or I could use HTML entity % or
perhaps use {% blocktrans %} and instead of % use some variable like {{
PERCENT_SIGN }}. But all of this is a little bit complicated so I first
need to know if I am not doing something bad or perhaps there is a bug in
Django.
Thanks,
Martin
--
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.