Changes between Version 2 and Version 3 of Ticket #24257, comment 4
- Timestamp:
- Apr 24, 2015, 1:06:03 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #24257, comment 4
v2 v3 36 36 This is awkward because the single `%` is seen as invalid python format and so the message id is not marked as we would expect. 37 37 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 40 38 '''str fmt / sprintf is awkward.''' 41 39 … … 52 50 }}} 53 51 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.52 These two bits awkwardness has caused some confusion as past developers have tried to shoehorn the template language into gettext & str fmt. 55 53 56 54 Example: … … 69 67 }}} 70 68 69 The first is a potential source of bugs. If the translation comes back: 70 {{{ 71 Blocktrans extracción no debe duplicar escapar esta : % , a = %(a) s 72 }}} 73 Gettext 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 `%`. 71 74 72 75 == The solution ==