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



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

msgfmt -cv doesn't complain when there's only one specifier, like:
Foo %d bar.

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

msgfmt -cv does complain if I drop the %d here. "Foo bar %2$s baf" makes
msgfmt -cv complain about a missing %1$d. Apparently, at least in plural
strings, I can only drop specifiers from the right of the string, I.e.
with five specifiers I can drop #4 and #5, but not just #4, because then
#5 gives an error.

nn-mo.po:549: 'msgstr[1]' is not a valid C format string, unlike
'msgid'. Reason: The string refers to argument number 2 but ignores
argument number 1.
msgfmt: found 1 fatal error

-- 
Åsmund Skjæveland <aasmunds@fys.uio.no>




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