Created attachment 4049 Change function format_with_thousandssep into format_byte_humanreadable. These are follow-up patches to bug 7804. They format numbers not only into formats with thousand separators, but also with byte size units. This way, they take less space in the panel and it will become more predictable how much space will be needed for display. We can set the label char width from 13 to 10 now.
Created attachment 4050 This updates the german translation.
#: ../panel-plugin/netload.c:820 msgid "Show bars" msgstr "Balken anzeigen" Anyway I think it is part of show-values.patch
Created attachment 4052 Change unit in options dialog accordingly.
Attachment 4049 doesn't apply against git properly anymore. || mike@devian:~/xfce/goodies-qa/xfce4-netload-plugin$ git apply < 005-format-units.patch || error: patch failed: panel-plugin/netload.c:231 || error: panel-plugin/netload.c: patch does not apply
Created attachment 4088 Change function format_with_thousandssep into format_byte_humanreadable. No problem, this one should work. BTW: For the translation of unit strings I used gettext(), no change here. However, I wonder why I can use N_() or _() in other parts of the code but not in utils.c. I seem to have missed something, maybe you can enlighten me?
(In reply to comment #5) > Created attachment 4088 > Change function format_with_thousandssep into format_byte_humanreadable. > > No problem, this one should work. I units over GiB since they don't make sense (even GiB doesn't make sense, but this one is used for tolerance). I also changed the strcat call to strlcat in order to not exceed the maximum size of the variable 'string'. > BTW: For the translation of unit strings I used gettext(), no change here. > However, I wonder why I can use N_() or _() in other parts of the code but not > in utils.c. I seem to have missed something, maybe you can enlighten me? http://developer.gnome.org/glib/stable/glib-I18N.html#N-:CAPS This function doesn't use gettext and actually returns a simple string, but is needed to mark the string in the translation files. The file units.c needed to include the header file <glib/gi18n.h>.
Pushed in git master. 6256c6c..e7f6355
Ok, thanks for the corrections and information. Could you apply the other patch (attachment 4052 ) too, please?
(In reply to comment #8) > Ok, thanks for the corrections and information. Could you apply the other patch > (attachment 4052 ) too, please? Done.