#11240: Compilemessages fails if a % character is at certain places in the .po 
file
-----------------------------------------+------------------------------
               Reporter:  tback          |          Owner:  garcia_marc
                   Type:  Uncategorized  |         Status:  reopened
              Milestone:                 |      Component:  Translations
                Version:  1.3            |       Severity:  Normal
             Resolution:                 |       Keywords:
           Triage Stage:  Accepted       |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
-----------------------------------------+------------------------------
Changes (by benjaoming):

 * status:  closed => reopened
 * severity:   => Normal
 * resolution:  worksforme =>
 * component:  Documentation => Translations
 * version:  1.0 => 1.3
 * easy:   => 0
 * type:   => Uncategorized


Comment:

 @ramiro:
 > Note the reporter claims he extracted the translatable literal from a
 template but it is prefixed by a #, python-format flag in the PO file, and
 that's not consistent.

 That's very consistent: It is compilemessages that generated this flag,
 because it saw a '%' in the string!

 > because I don't see any change committed to the compilemessages
 management command related to this.

 Sorry, but that's not enough. You're right that the error message will go
 away. Nonetheless, two percentage characters are outputted when using {%
 trans "findme 10%%" %}: "findme 10%%"

 Reopening. I have reproduced it on Django 1.3 and 1.2. As of now, the fix
 is to use blocktrans instead, in which case you write:

 {{{
 {% blocktrans %}findme 10%{% endblocktrans %}
 }}}

 ...producing correct .po gramma:

 {{{
 #, python-format
 msgid "findme 10%%"
 msgstr "findme 10%%"
 }}}

 ...and it will correctly output "findme 10%".

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11240#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to