bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for xgettext non-reorderable format string warning regression in v


From: Max Smolens
Subject: Patch for xgettext non-reorderable format string warning regression in v0.21
Date: Mon, 5 Oct 2020 20:07:37 -0400

Hi,

Attached is a patch for a bug where the non-reorderable format string warning is not displayed. This is a regression in v0.21 introduced by commit d079c75.

For example, with the following example file code_sample.py:

    from django.utils.translation import gettext

    # This will generate an xgettext warning
    my_string = gettext("This string contain two placeholders: %s and %s" % ('a', 'b'))

v0.20.2 displays the following warning:

    $ xgettext --language=Python ./code_sample.py
    ./code_sample.py:4: warning: 'msgid' format string with unnamed arguments cannot be properly localized:
                                 The translator cannot reorder the arguments.
                                 Please consider using a format string with named arguments,
                                 and a mapping instead of a tuple for the arguments.

But v0.21 does not.

Thanks,
Max

Attachment: 0001-xgettext-Fix-non-reorderable-format-string-warning.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]