bug-gettext
[Top][All Lists]
Advanced

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

[bug #64359] xgettext: "python-format" error in "Advanced String Formatt


From: Bruno Haible
Subject: [bug #64359] xgettext: "python-format" error in "Advanced String Formatting"
Date: Tue, 27 Jun 2023 14:52:07 -0400 (EDT)

Update of bug #64359 (project gettext):

                Category:        Translator tools => Python                 
                  Status:                    None => Answer Provided        
             Assigned to:                    None => haible                 
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

I reproduce also with xgettext 0.22.

For xgettext it looks like the string could a python-format string or a
python-brace-format string. xgettext does not do a program analysis, to
determine how the string is used. Therefore it marks the string with both
markers.

To remedy in this special case, add a comment directed to xgettext:

#!/usr/bin/env python3
import gettext
_ = gettext.gettext

val = '15'
# xgettext: no-python-format
print(_('Trying to keep min {perc}% free inodes').format(perc=val))


Then xgettext will no longer emit the python-format marker here.

See the documentation:
https://www.gnu.org/software/gettext/manual/html_node/c_002dformat-Flag.html
https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64359>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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