|
From: | Alexander Dupuy |
Subject: | Re: [Translation-i18n] Memory management in gettext? |
Date: | Tue, 14 Sep 2010 08:17:36 -0400 |
User-agent: | Thunderbird 2.0.0.14 (X11/20080501) |
Chris Scaife wrote:
In my project I wanted to differentiate on negative values for ngettext and dngettext pluralization. Sadly they only work with unsigned long integers. Part of the problem is that on some systems this can be 32 bit and on others 64 bit. I'm hoping to suggest to the GNU gettext team that we could use signed values instead. For the time being, I've wrapped my pluralizing numbers that are above 10000 into the space 10000 - 19999... and then negative values can be discovered by testing > 20000 in the .po pluralization formula. It's not an elegant solution so if anyone has alternative suggestions I would love to hear :)
Another possibility would be that rather than mapping numbers into a particular range (yours is probably fine but one never knows) you could have your function make two separate calls to [d]ngettext, with different message contexts (negative numbers would have " (negative values)" appended to the default context or something like that).
This is a little inelegant for the translators, in that the .po file will contain the same message twice (with different contexts) but at least it will be very explicit what is going on, and in any language where a negative value requires different translation, it will be quite clear to the translator what needs to be done.
@alex -- mailto:address@hidden
[Prev in Thread] | Current Thread | [Next in Thread] |