bugGNU gettext - Bugs: bug #48872, msgfmt.exe doesn't show format...


You are not allowed to post comments on this tracker with your current authentication level.

bug #48872: msgfmt.exe doesn't show format specification error in msgstr[0]

Submitter:  None
Submitted:  Tue 23 Aug 2016 04:08:25 PM UTC
Category:  Translator tools Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Sun 28 Aug 2016 05:06:14 PM UTC, comment #1: 

To clarify: the submitter originally posted this as a Poedit bug (see https://groups.google.com/forum/#!msg/poedit/vlEQ55jdabo/zGAwYanLBQAJ).

It’s fine that msgfmt -c doesn’t complain about the lack of {selnum} in msgstr[0] (singular). That’s of course desirable, because some languages strongly prefer to express “1 something” without using the “1” number.

What isn’t fine is that it doesn’t complain about other errors such as the above example {selnum123}, which are unrelated to this singular special case. The error given (lack of selnum) for msgstr[1] is misleading, but if you use “{selnum} {selnum123} of {maxnum}" instead, you get the expected "a format specification for argument 'selnum123' doesn't exist in 'msgid_plural’”… That’s something that should be reported for singular translations & msgid as well.

Vaclav Slavik <vslavik>
Tue 23 Aug 2016 04:08:25 PM UTC, original submission:  

I have following code in test.po file:

#: test.py:8
#, python-brace-format
msgid "[{selnum} of {maxnum} object selected]"
msgid_plural "[{selnum} of {maxnum} objects selected]"
msgstr[0] "[{selnum123} von {maxnum} Objekt selektiert]"
msgstr[1] "[{selnus} von {maxnum} Objekten selektiert]"

{selnum123} in msgstr[0] shows no format specification error from 'msgfmt.exe' if you run with option '--check'.

The same problem, if:
msgstr[0] "[{selnum} {selnum123} von {maxnum} Objekt selektiert]"

If you use a wrong specification in msgstr[1] its raise an error properly. Also if you work without plural.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #38330:  test.po added by None (681B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-27 haible CategoryNone Translator tools
    2016-08-23 None Attached File- Added test.po, #38330

    Back to the top

    Powered by Savane 3.12