The use of positional arguments in translations



Just a quick note from a maintainer than has been burned by these.
Please be very careful about using positional transposition of
arguments when translating C format strings.

    eg translating "Arg1 %s Arg2 %d" as "Arg2 %2$d Arg1 %1$s"

On some systems there is a serious limitation in glib's
g_printf_string_upper_bound routine.  It does not understand the
transposition.  This will cause crashes if you happen to exchange
arguments of different types.  In the example above glib will
attempt to read the integer as a string pointer ...

Positional arguments can be used provided that glib is _not_
involved in the interpretation.  So please check with package
maintainers for all uses of this idiom.

thanks




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