bug-gettext
[Top][All Lists]
Advanced

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

[bug #65858] msgfmt -c doesn't detect broken format specifiers in transl


From: Bruno Haible
Subject: [bug #65858] msgfmt -c doesn't detect broken format specifiers in translations
Date: Sun, 9 Jun 2024 20:21:00 -0400 (EDT)

Follow-up Comment #3, bug #65858 (group gettext):

msgfmt does as documented in
https://www.gnu.org/software/gettext/manual/html_node/msgfmt-Invocation.html#Input-file-interpretation-1
:
"If the string represents a format string used in a printf-like function both
strings should have the same number of ‘%’ format specifiers, with
matching types."

The types need to match because in general, it makes no sense to feed to, say,
an integer-consuming directive a string, or vice versa. This is true for all
programming languages. In C, additionally, this would cause a crash at
runtime, and the use of 'msgfmt -c' prevents that crash.

We leave to the translator the freedom to use a different format directive,
because that is useful in some contexts. For example, when formatting columns
of a table, in English a column might be 6 characters wide, whereas in another
language the translator might choose to allocate 10 units of width to it.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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