To the German, Dutch, and Vietnamese translators of e2fsprogs's po
file, --- I've added you to the cc list because Martin von Wittich has
pointed out the following error in your translation files.  Please
read on....

On Tue, Mar 06, 2018 at 01:15:56PM +0100, Martin von Wittich wrote:
> the German localization of the following message:
> 
> some-server ~ # LANG=C e2fsck -f /dev/vg/some-lv
> e2fsck 1.43.4 (31-Jan-2017)
> Pass 1: Checking inodes, blocks, and sizes
> Inode 529618 extent tree (at level 1) could be shorter.  Fix<y>?
> 
> contains uninterpreted escape sequences instead of the actual values:
> 
> some-server ~ # LANG=de_DE.UTF-8 e2fsck -f /dev/vg/some-lv
> e2fsck 1.43.4 (31-Jan-2017)
> Durchgang 1: Inodes, Blöcke und Größen werden geprüft
> Der Erweiterungsbaum von Inode %$i (auf Ebene %$b) könnte kürzer sein.  
> Reparieren<j>?
> 
> If I understand the issue correctly, the translations are attempting to use a
> printf escape that might not be supported by the compiler...? Wikipedia says
> "Parameter field - This is a POSIX extension and not in C99."

Thanks for pointing out the problem.  The issue is that the
translators how they should handle positional ordering issues when
translating e2fsck's message.

This is what is in po/de.po in the e2fsprogs sources:

#. @-expanded: inode %i extent tree (at level %b) could be shorter.  
#: e2fsck/problem.c:1301
msgid "@i %i @x tree (at level %b) could be shorter.  "
msgstr ""
"Der Erweiterungsbaum von Inode %1$i (auf Ebene %2$b) könnte kürzer sein.  "

This is wrong.  It should have simply been:

"Der Erweiterungsbaum von Inode %i (auf Ebene %b) könnte kürzer sein.  "

That's because how e2fsck interprets its own error messages, and it
does its own specialized %-expansion.   From e2fsck/message.c:

 *      %b      <blk>                   block number
 *      %B      <blkcount>              interpret blkcount as blkcount
 *      %c      <blk2>                  block number
 *      %Di     <dirent>->ino           inode number
 *      %Dn     <dirent>->name          string
 *      %Dr     <dirent>->rec_len
 *      %Dl     <dirent>->name_len
 *      %Dt     <dirent>->filetype

etc.  So the translators don't need to play magical games with
positional arguments.  They just need to use %i when they want to
print the inode number from the problem context structure.  And they
can use %p if they want e2fsck to try to take a directory inode number
and turn it into a pathname, and print the pathname.  If there is a
timestamp in the num field in the problem context, %t will print it as
a human-readiable date/time stamp.  Ordering doesn't matter, so the
attempt to use %1$i, %2$b, is Just Wrong.

> The following *.po files might be affected:
> 
> martin@dogmeat ~/Projects/e2fsprogs/po % grep -lP '\d\$' *.po
> cs.po
> de.po
> hu.po
> nl.po
> pl.po
> tr.po
> vi.po
> zh_CN.po

Actually, not all of these are buggy.  Using positional arguments is
the right thing to do for messages that are *not* from
e2fsck/problem.c.  It's only the messages from e2fsck/problem.c which
are use the the %-expansion in e2fsck/message.c.  From examination,
the only other languages that are buggy in this way are the Dutch and
Vietnamese translations.  I've cc'ed their translators above.

Thanks again for pointing this out.

Cheers,

                                                - Ted

Reply via email to