From: Jeff D. <da...@da...> - 2001-12-19 05:16:30
|
Carsten Klapp said: > 1. Variable reordering. In the case where word ordering differs during > translation, the gettext manual suggests the following syntax to force > the correct text substitution: > > #: ../lib/diff.php:251 > #, c-format > msgid "Differences between %s and %s of %s." > msgstr "Der Unterschiedsergebnis von %3$s, zwischen %1$s und %2$s." I've just checked three new functions into lib/stdlib.php. __printf, __sprintf, and __vsprintf. These behave like the PHP's built-in printf functions, except: 1. They pass the format string through gettext(). 2. The support the above method of argument reordering. (I've also fixed locale/Makefile, so that xgettext will find the format strings of __printf()s, __sprintf()s, __vsprintf()s...) For the argument reordering to work, code like: printf(gettext("..format string.."), ..., ...); needs to be changed to: __printf("..format string..", ..., ...); (And similarly for sprintf.) |