[Top][All Lists]

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

msgunfmt | msgfmt produces different .mo

From: Egmont Koblinger
Subject: msgunfmt | msgfmt produces different .mo
Date: Wed, 16 Aug 2006 14:33:29 +0200
User-agent: Mutt/1.5.8i

Hi there,

Is an msgunfmt followed by an msgfmt supposed to create a functionally
equivalent .mo file? I do think so. However, I found a case where it is not

Try "dd" (coreutils-5.97) with "hu_HU" (or probably any other non-English)
locale. It works perfectly. Then do this:
cd /usr/share/locale/hu/LC_MESSAGES
msgunfmt coreutils.mo | msgfmt -o coreutils2.mo -
mv coreutils2.mo coreutils.mo

Try "dd" again in Hungarian. The "1+0 records in/out" are printed in
English, and then it segfaults.

The bug is somehow caused by the %<PRIuMAX> magic which I don't yet
completely understand. However, I noticed that the "c-format" specifier is
required in the .po files for these strings to work correctly. Originally it
is there in coreutils' source, but msgunfmt doesn't put these in the newly
re-created .po file. As a result, when it is formatted to a .mo again, it
will be different.

Looking at the raw .mo files, the correct version contains a single % sign
at the translation of %<PRIuMAX>, while in the result of unformatting and
formatting again (i.e. dropping the c-format keyword) the resulted .mo file
contains %<PRIuMAX> in the translated messages.

I think msgunfmt should put that "#, c-format" in the generated .po file
where it is necessary, so that an msgunfmt followed by an msgfmt always
produces a .mo file that behaves the same way.

Tested with gettext 0.14.5 and 0.15.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]