On 08/09/2013 05:24 AM, Pádraig Brady wrote: > On 08/09/2013 04:54 AM, Filipus Klutiero wrote: >> My df outputs something like: >>> Sys. de fichiers blocks de 1K Utilisé Disponible Uti% Monté sur >>> /dev/sda5 37534240 24181584 11439364 68% / >>> udev 10240 0 10240 0% /dev >>> tmpfs 756064 572 755492 1% /run >>> tmpfs 5120 0 5120 0% /run/lock >>> tmpfs 1845740 4 1845736 1% /run/shm >>> /dev/sdc3 20641788 16697020 2896128 86% /mnt/work >> >> In English, the header would be: >>> Filesystem 1K-blocks Used Available Use% Mounted on >> >> So "1K-blocks" is translated to "blocks de 1K". It turns out that this isn't >> a problem in the po file: >> >>> #. TRANSLATORS: this is the "1K-blocks" header in "df" output. >>> #. TRANSLATORS: this is the "1024-blocks" header in "df -P". >>> #: src/df.c:545 src/df.c:554 >>> #, c-format >>> msgid "%s-%s" >>> msgstr "%2$s de %1$s" >> >> The po file does its best given the msgid given, but it's not given the >> opportunity to translate "block" itself, which is "bloc" in French. For >> French, this simply looks like a typo/translato. In Spanish and many other >> languages, this must be more striking. >> >> I believe this can be fixed by calling gettext with a string built using a >> string already translated by gettext. >> > > This might fix it up: > > diff --git a/src/df.c b/src/df.c > index c2c390e..949fe2f 100644 > --- a/src/df.c > +++ b/src/df.c > @@ -539,7 +539,7 @@ get_header (void) > char *num = human_readable (output_block_size, buf, opts, 1, 1); > > /* Reset the header back to the default in OUTPUT_MODE. */ > - header = N_("blocks"); > + header = _("blocks"); > > /* TRANSLATORS: this is the "1K-blocks" header in "df" output. */ > if (asprintf (&cell, _("%s-%s"), num, header) == -1)
I confirmed that this fixes the specific issue, and pushed the above. thanks, Pádraig.