Re: Is it okay to not use %d in msgstr, even if %d in msgid?



Åsmund Skjæveland <aasmunds@ulrik.uio.no> writes:
>
> Do I have to use the '%d' in [0], or can i use a word for 'one' instead
> of the number 1?
>

I don't think it's neccessary — I did it in a couple of places, and
neither msgfmt, nor the compiler complained.

Though, you would have to watch for some cases, like when there are
more format specifiers, eg.
 msgid_plural "Waiting for %d seconds [%s]"

If you simply drop "%d" here, whatever *printf command is used will
use the number of seconds as a pointer to string, which most likely
means a Segmentation fault (unless you're privileged enough to access
memory at 0x1, when %d is 1; i.e. you're a kernel :), and a bug which
developers would hate to debug (I guess).

So, be careful if you do it ;)

Cheers,
Danilo



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]