Ubuntu

National translations of "df" output misaligned

Reported by gwi on 2008-01-10
180
This bug affects 31 people
Affects Status Importance Assigned to Milestone
Ubuntu Translations
Low
Unassigned
coreutils (Ubuntu)
Undecided
Unassigned

Bug Description

Sample df output (should be viewed with a fixed-width font):
Bestandssysteem 1K-blokken Gebruikt Beschikbr Geb% Aangekoppeld op
/dev/sda2 4127108 569396 3389996 15% /
varrun 1553544 240 1553304 1% /var/run
varlock 1553544 0 1553544 0% /var/lock
udev 1553544 84 1553460 1% /dev
devshm 1553544 0 1553544 0% /dev/shm
lrm 1553544 34696 1518848 3% /lib/modules/2.6.22-14-generic/volatile
/dev/sda1 97826 22697 69910 25% /boot
/dev/sda6 16516052 7696336 7980724 50% /home
/dev/sda8 16508572 3014208 12655776 20% /usr
/dev/sda7 16516052 6098240 9578820 39% /var

In the header line, between "Bestandssysteem" and "1K-blokken" there are 6 spaces too many.
Between "1K-blokken" and "Gebruikt" there is one space too few.
This makes the header misaligned with the following data lines, and makes reading the output less than optimal.

LAST VERSION REPORTED: Maverick 10.10

Pavel Mlčoch (pavkamlc) wrote :

I think, this no bug in translation, but in sources. In czech translation is errorneously aligned only caption, because word "Filesystem" is translated into long string "Souborový systém"

joenix (woutersj) wrote :

I have just noticed the strangest thing. If I compile the package from source, then this problem disappears. This is on Intrepid beta.
Here's what I do:

apt-get source coreutils
cd coreutils-6.10/
dpkg-buildpackage -rfakeroot
sudo dpkg -i ../coreutils_6.10-6ubuntu1_i386.deb

Did this just get fixed and do I need to wait for an update?

Martijn vdS (martijn) wrote :

I'm using the Dutch locale as well, and I see the same problem.

Changed in coreutils:
status: New → Confirmed
Martijn vdS (martijn) wrote :

Note that I didn't confirm the proposed fix.

Katsudon (katsudon) wrote :

The same problem concerns the Polish translation for "df" and "df -h" in Ubuntu Karmic.

summary: - Dutch translation of "df" output misaligned
+ National translations of "df" output misaligned
Dmitry Petrov (demon-krasno) wrote :

The same story is with Russian translation df and df -h are aligned wrong

C de-Avillez (hggdh2) wrote :

subscribing the translation team.

David Planella (dpm) wrote :

Adding a task for the Ubuntu Translations project as per https://wiki.ubuntu.com/Bugs/HowToTriage#Translation%20Bugs%20and%20Launchpad%20integration, thanks for the heads up.

LukeKendall (luke-zeta) wrote :

I can confirm the same is true even within English variants. Speaking to one of the coreutils developers about it, he said:

"It's to do with your locale:

$ head -n1 /etc/issue
Ubuntu 9.10 \n \l

$ dpkg -s coreutils | grep Version
Version: 7.4-2ubuntu1

$for LANG in en_AU.utf8 en_IE.utf8; do df | head -n2; done
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 14421344 6657252 7031532 49% /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 14421344 6657252 7031532 49% /

Interestingly I can't reproduce it on fedora 11 (coreutils-7.2) or
fedora 12 (coreutils-7.6), or on en_AU on unbuntu.
Note coreutils doesn't provide english variant translations,
while ubuntu does, so I'm guessing it's an issue with the
en_AU ubuntu coreutils translation?"

This bug has also been present for something like two years.

$ for LANG in C en_AU en_AU.utf8 en_IE.utf8; do df | head -n2; done
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/md1 12389244 10877944 881960 93% /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/md1 12389244 10877944 881960 93% /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/md1 12389244 10877944 881960 93% /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/md1 12389244 10877944 881960 93% /

I believe this to be because of bug #30358. If anyone wants to dive into code of Launchpad Translations and fix this, I'd be happy to give a few pointers on that bug.

David Planella (dpm) on 2010-02-21
Changed in ubuntu-translations:
importance: Undecided → Low
status: New → Confirmed
David Planella (dpm) on 2010-08-23
Changed in ubuntu-translations:
status: Confirmed → Triaged
C de-Avillez (hggdh2) on 2010-09-16
description: updated
Radoslaw (radw) wrote :

It seems the issue has two roots (at least for Polish translation):

1. upstream translation - similiar issue is also visible in other distributions than Ubuntu.

Solution is fixing translation due to the guideline at upstream .po file:

"
#. TRANSLATORS:
#. For best results (df header/column alignment), ensure that
#. your translation has the same length as the original.
#. Also, each column name translation should end at the same
#. column as the corresponding original.
#: src/df.c:163
"

The guidline is present in more recent coreutils package than 7.4 (that on Ubuntu 10.04), I don't know exactly at what version it was added. The above is taken from coreutils 8.8 po/pl.po you can find at upstream site).

2. Ubuntu translation - the df output is even more shifted than the original one

Solution/workaround is the same as above.

For Polish translation there is a patch provided within bug report that has been marked as duplicate of this bug:

https://bugs.launchpad.net/ubuntu-translations/+bug/695856

link to the patch file:

https://bugs.launchpad.net/ubuntu-translations/+bug/695856/+attachment/1780027/+files/language-pack-pl-base_df-header-fix.patch

LukeKendall (luke-zeta) wrote :

If it's of any help to know, the output is almost correctly aligned on an English system if you use the human (-h) option of df. (It's only off by one space, starting from the"Size" column).
Perhaps the alignment code for that case could be factored out and used more generally?

luke

[code]
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 19G 12G 6.4G 64% /
udev 2.0G 316K 2.0G 1% /dev
none 2.0G 228K 2.0G 1% /dev/shm
none 2.0G 380K 2.0G 1% /var/run
none 2.0G 0 2.0G 0% /var/lock
none 2.0G 0 2.0G 0% /lib/init/rw
none 19G 12G 6.4G 64% /var/lib/ureadahead/debugfs
...

$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda6 19228276 11629644 6621884 64% /
udev 2060668 316 2060352 1% /dev
none 2060668 228 2060440 1% /dev/shm
none 2060668 380 2060288 1% /var/run
none 2060668 0 2060668 0% /var/lock
none 2060668 0 2060668 0% /lib/init/rw
none 19228276 11629644 6621884 64% /var/lib/ureadahead/debugfs
[/code]

Radoslaw (radw) wrote :

@LukeKendall

You must be speaking about some other English than US. With LANG=en_US the output is perfectly aligned:

$ LANG=en_US df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 18G 6.3G 11G 38% /
none 245M 272K 244M 1% /dev
none 249M 100K 249M 1% /dev/shm
none 249M 204K 249M 1% /var/run

..

$ LANG=en_US df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 18379072 6529072 10916368 38% /
none 250128 272 249856 1% /dev
none 254344 100 254244 1% /dev/shm
none 254344 204 254140 1% /var/run

(the output should be watched with fixed width font)

LukeKendall (luke-zeta) wrote :

Yes, you're right: it's okay if I use LANG set to C, en_AU or en_IE.utf8. But I'm actually using en_AU.utf8, fr which it is badly misaligned.

Also, doing the same test for df -h, for en_AU.utf8 they're almost aligned (out by 1), and for all the other above locales they align perfectly.

HTH,

luke

Igor A Tarasov (dicr) wrote :

It's affect me too.

LANG=ru_UA.utf8

df output has shifted right tile :(

eiku (florian-mortgat) wrote :

Same in French (LANG=fr_FR.utf8):

"Filesystem" becomes "Sys. de fichiers" and the tabulation is misaligned.

I can confirm it's the same for Serbian.

Workaround from joenix (comment #2) still work in 10.10...

It works well in Ubuntu 12.04.
You might consider closing it.

yurikoles (yurikoles) on 2012-05-20
Changed in coreutils (Ubuntu):
status: Confirmed → Fix Released
Changed in ubuntu-translations:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments