Problem with "trans" and "blocktrans"

222 views
Skip to first unread message

Andre Hagenbruch

unread,
Dec 10, 2011, 1:52:32 AM12/10/11
to djang...@googlegroups.com
Hi all,

I have two files with equal strings to translate, in the first file
with "trans" and in the second file with "blocktrans" and a plural form:

a.html:
{% trans 'My string' %}

b.html:
{% blocktrans count counter=mylist|length %}My string{% plural %}My
strings{% endblocktrans %}

and when I run "django-admin.py makemessages -l de" I get

django.po
#: templates/a.html:108
#: templates/b.html:3
msgid "My string"
msgstr ""

and not as I'd expect

django.po
#: templates/a.html:108
#: templates/b.html:3
msgid "My string"
msgid_plural "My strings"
msgstr[0] ""
msgstr[1] ""

I can reproduce this for similar structures in other files.
"blocktrans" strings that don't have "trans" equivalents in other
files correctly produce entries with plural forms in the .po file.
What's going wrong here?

Any help would be greatly appreciated,

Andre

Claude Paroz

unread,
Dec 10, 2011, 9:56:21 AM12/10/11
to djang...@googlegroups.com

Hi Andre,

This is obviously a bug in the makemessages command. Could you please
open a ticket on Django bug tracker?

Claude
--
www.2xlibre.net

Claude Paroz

unread,
Dec 10, 2011, 11:30:48 AM12/10/11
to djang...@googlegroups.com

After some more tests, it seems rather to be a bug in msguniq (from
gettext package). I just reported the bug [1].

Nevertheless, you might still report the bug in Django, because we might
workaround it by giving a list of files to xgettext instead of running
msguniq on the concatenation of messages.

[1] https://savannah.gnu.org/bugs/index.php?35027

Claude
--
www.2xlibre.net

Andre Hagenbruch

unread,
Dec 10, 2011, 12:13:49 PM12/10/11
to djang...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 10.12.11 17:30, schrieb Claude Paroz:

Hi Claude,

> Nevertheless, you might still report the bug in Django, because we might
> workaround it by giving a list of files to xgettext instead of running
> msguniq on the concatenation of messages.

thanks for looking into this. I filed a bug report under
<https://code.djangoproject.com/ticket/17375>

Andre
- --
If you give a good idea to a mediocre team they will screw it up; if you
give a mediocre idea to a great team they will either fix it or throw it
away and come up with something that works.
Ed Catmull -- Pixar
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7jk00ACgkQ3wuzs9k1icVz2ACgrk/pKUpVnHoaRmeVniqvw4SZ
M9wAoID212cXgE9hZ+iyb2W/gTqCYxL5
=NwI0
-----END PGP SIGNATURE-----

Reply all
Reply to author
Forward
0 new messages