# Re: \[PATCH 3/5\] index-pack: correct "len" type in unpack\_data()

- List: git
- 1 message, 1 author
- Page: https://ratatoskr.run/git/2016/07/7685083/t

## Re: \[PATCH 3/5\] index-pack: correct "len" type in unpack\_data()

- From: Junio C Hamano \<hidden\>
- Date: 2016-07-06 16:09:10 
- Message: https://ratatoskr.run/git/2016/07/7685083.md

```text
Junio C Hamano [ref] writes:

> Duy Nguyen [ref] writes:
>
>> What can I say, gettext is smart. In gc.c we already have this
>>
>> die(_("gc is already running on machine '%s' pid %"PRIuMAX" (use
>> --force if not)"), name, (uintmax_t)pid);
>>
>> and vi.po shows
>>
>> #: builtin/gc.c:397
>> #, c-format
>> msgid ""
>> "gc is already running on machine '%s' pid %<PRIuMAX> (use --force if not)"
>
> And translators are expcted to keep "%<PRIuMAX>" in their translated
> .po files, and whatever translates .po into .mo knows what
> %<PRIuMAX> should be mapped to?
>
> That is surprising.

gettext.info answered me ;-)

    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);

    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".

       This works only for the predefined ‘<inttypes.h>’ macro...

Nice.
```
