4 ms·
How is this supposed to work? The underscore is a convenience macro for the gettext localization function. But gettext works by looking up its string argument i
by garethrees 11y ago
How is this supposed to work? The underscore is a convenience macro for the gettext localization function. But gettext works by looking up its string argument in the localization database, and here the string varies from one platform to another, so how can you be sure that the localization will be found?
I guess the answer is that you have to redo the localization for each platform that has a different expansion of PRIuMAX. But that's horrible: the localization will be identical except for the format specifiers, which will just be copied from the English version of the string. Is there support for automating this in the translation toolchain?
- arantius 11y agoWhat is the behavior of gettext() if the message is not found? (This question is the answer to your question.)
- garethrees 11y agoIf the message is not found, gettext returns the argument unchanged, which would be a bug (English text incorrectly appearing instead of localized text). So that's not it. The answer to my question is that xgettext and gettext have special handling for PRIuMAX and the other formatting macros in inttypes.h. http://www.gnu.org/software/gettext/manual/gettext.html#Preparing-Strings http://www.gnu.org/software/gettext/manual/gettext.html#Prep...