Looking for people's experience with po files.
VirginSnow at vfemail.net
VirginSnow at vfemail.net
Wed Sep 10 13:08:09 EDT 2008
> Date: Wed, 10 Sep 2008 12:14:13 -0400
> From: Dan Coutu <coutu at snowy-owl.com>
> po files are a part of the gettext solution for handling
> internationalization (i18n).
Good explanation of gettext <snipped>...
> part of what gettext handles by default. The trick there is to use
> gettext to obtain the translation and then do string processing (your
> language's equivalent of sprintf) in order to do the variable
> substitution. There are, however, potential pitfalls with this logic.
> Not all languages place words in the same order. What is one language
> might be "You have 10 items in your shopping cart worth $50 total" might
> in another language read more like "Your total of $50 is for item count 10".
Most versions of printf will allow you to rearrange the order in which
conversion specifiers consume arguments by using "%n$" where you would
normally use "%". Example:
printf("number1 is %2$d, and number2 is %1$d.\n", number2, number1);
does the same thing as
printf("number1 is %d, and number2 is %d.\n", number1, number2);
More information about the gnhlug-discuss
mailing list