bug-gettext
[Top][All Lists]
Advanced

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

[bug-gettext] GNU gettext plural forms manual page uses incorrect '%$2d'


From: Jonathan Leffler
Subject: [bug-gettext] GNU gettext plural forms manual page uses incorrect '%$2d' instead of correct '%2$d'
Date: Sat, 19 Mar 2016 12:56:49 -0700

In the GNU gettext utilities manual at: https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html, there is the suggested function call:

printf (ngettext ("%$2d file removed from directory %$1s",
                  "%$2d files removed from directory %$1s",
                  n),
        dir, n);
However, both POSIX (http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html) and the cross-referenced 'C format strings' (https://www.gnu.org/software/gettext/manual/html_node/c_002dformat.html#c_002dformat) show that it should be 'n$' rather than '$n' — that is, the correct call should be:

printf (ngettext ("%2$d file removed from directory %1$s",
                  "%2$d files removed from directory %1$s",
                  n),
        dir, n);

--
Jonathan Leffler <address@hidden>  #include <disclaimer.h>
Guardian of DBD::Informix - v2015.1101 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be amused."

reply via email to

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