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


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

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24257, comment 4

    v3 v4  
    5757}}}
    5858
    59 The correct msgid is:
     59Currently django creates msgid:
     60{{{
     61Blocktrans extraction shouldn't double escape this: %%, a=%(a)s
     62}}}
     63
     64This is wrong, the correct msgid needs to be:
    6065{{{
    6166Blocktrans extraction shouldn't double escape this: %%%%, a=%(a)s
    6267}}}
    6368
    64 Not:
    65 {{{
    66 Blocktrans extraction shouldn't double escape this: %%, a=%(a)s
    67 }}}
     69There is a series of negative side-effects.
    6870
    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 `%`.
     711. The string `1 percent sign %, 2 percent signs %%` is extracted as `1 percent sign %%, 2 percent signs %%`
     72
     732. A weird string like `{{item}} costs 10%, three percent signs %%%` will not get marked `#, python-format`, Gettext will not complain when compiling messages and django will blow up because string interpolation chokes on `%%%` (seeing it as a percent sign followed by a broken identifier).
    7474
    7575 == The solution  ==
Back to Top