GNOME Bugzilla – Bug 699503
nmcli headers don't line up right in some localizations
Last modified: 2013-05-31 07:54:02 UTC
danw@laptop:NetworkManager (master)> nmcli dev DEVICE TYPE STATE wlan0 802-11-wireless connected em1 802-3-ethernet disconnected danw@laptop:NetworkManager (master)> LANG=es_ES.utf8 nmcli dev DISPOSITIVO TIPO ESTADO wlan0 802-11-wireless conectado em1 802-3-ethernet desconectado I guess it needs to make sure that each column is at least as wide as its header...
Actually, we need to know the widest string in a column to be able to align the column properly. And it requires first collect all data before printing. I wanted to do the enhancement long time, but didn't get round to it until now, because it was quite a complex change. Nevertheless, I've implemented the change now and it is available in jklimes/nmcli-enh-output branch. I'd like to ask you for a review.
> value = _(fields->name_l10n); Hmm, any idea how this works for translators? Obviously it works at runtime, but I have no idea how this shows up in the text that translators actually look at... Anyway, looks good to me...
(In reply to comment #2) > > value = _(fields->name_l10n); > > Hmm, any idea how this works for translators? Obviously it works at runtime, > but I have no idea how this shows up in the text that translators actually look > at... > Apparently xgettext is clear enough and doesn't include variables into translatable messages, just literals. jklimes@gromit ~/work/NetworkManager/po$ make NetworkManager.pot INTLTOOL_EXTRACT="/usr/bin/intltool-extract" XGETTEXT="/usr/bin/xgettext" srcdir=. /usr/bin/intltool-update --gettext-package NetworkManager --pot
Pushed to master: 66098fa cli: trivial update of NmcOutputField initializers 1d1cfd7 cli: adapt the code for the new flags and printing facilities 7fe4345 cli: print_required_fields() - fix non-ASCII strings alignment in multiline e687078 cli: enhance printing to align tabular output properly and not to waste space