diff options
author | Bruno Haible <bruno@clisp.org> | 2002-07-25 13:05:49 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:08:42 +0200 |
commit | 9887a24bbd1ff9a8a6d0dde99b9933007e42cb57 (patch) | |
tree | 9bf2619b597c235f5e0267254488682307a0dff5 /doc/gettext.info-2 | |
parent | a3146f85487d9bef6a87bcdb1e0d2def7261a7c5 (diff) | |
download | external_gettext-9887a24bbd1ff9a8a6d0dde99b9933007e42cb57.zip external_gettext-9887a24bbd1ff9a8a6d0dde99b9933007e42cb57.tar.gz external_gettext-9887a24bbd1ff9a8a6d0dde99b9933007e42cb57.tar.bz2 |
Update for 0.11.4.
Diffstat (limited to 'doc/gettext.info-2')
-rw-r--r-- | doc/gettext.info-2 | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/doc/gettext.info-2 b/doc/gettext.info-2 index a914d46..e8660a8 100644 --- a/doc/gettext.info-2 +++ b/doc/gettext.info-2 @@ -580,25 +580,25 @@ as a formatting directive for outputting an `int64_t' integer through or something like this, depending on the platform. Assume you have code like - printf ("The amount is %0" PRId64 "\n"), number); + printf ("The amount is %0" PRId64 "\n", number); -After marking, this cannot become +The `gettext' tools and library have special support for these +`<inttypes.h>' macros. You can therefore simply write - printf (gettext ("The amount is %0") PRId64 "\n"), number); + printf (gettext ("The amount is %0" PRId64 "\n"), number); -because it would simply be invalid C syntax. It cannot become +The PO file will contain the string "The amount is %0<PRId64>\n". The +translators will provide a translation containing "%0<PRId64>" as well, +and at runtime the `gettext' function's result will contain the +appropriate constant string, "d" or "ld" or "lld". - printf (gettext ("The amount is %0" PRId64 "\n")), number); - -because the value of `PRId64' is not known to `xgettext', and even if -were, there would be three or more possibilities, and the translator -would have to translate three or more strings that differ in a single -letter. - - The solution for this problem is to change the code like this: + This works only for the predefined `<inttypes.h>' macros. If you +have defined your own similar macros, let's say `MYPRId64', that are +not known to `xgettext', the solution for this problem is to change the +code like this: char buf1[100]; - sprintf (buf1, "%0" PRId64, number); + sprintf (buf1, "%0" MYPRId64, number); printf (gettext ("The amount is %s\n"), buf1); This means, you put the platform dependent code in one statement, |