Changes between Version 2 and Version 3 of Ticket #24257, comment 4


Ignore:
Timestamp:
Apr 24, 2015, 1:06:03 AM (9 years ago)
Author:
Doug Beck

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24257, comment 4

    v2 v3  
    3636This is awkward because the single `%` is seen as invalid python format and so the message id is not marked as we would expect.
    3737
    38 This is a potential source of bugs.  If the translation comes back as `%s precio 10%`, compiling messages won't catch the issue since it is not marked python-format and django will blow up because string interpolation requires `%s precio 10%%`.
    39 
    4038'''str fmt / sprintf is awkward.'''
    4139
     
    5250}}}
    5351
    54 These two bits awkwardness in gettext and sprinf has caused some confusion as past developers have tried to shoehorn the template language into these technologies.
     52These two bits awkwardness has caused some confusion as past developers have tried to shoehorn the template language into gettext & str fmt.
    5553
    5654Example:
     
    6967}}}
    7068
     69The first is a potential source of bugs. If the translation comes back:
     70{{{
     71Blocktrans extracción no debe duplicar escapar esta : % , a = %(a) s
     72}}}
     73Gettext will not complain when compiling messages because it is not marked `#, python-format` and django will blow up because string interpolation chokes on the single `%`.
    7174
    7275 == The solution  ==
Back to Top